@Override
	public Rectangle getBoundingBox() {
		int smallestx = Integer.MAX_VALUE;
		int smallesty = Integer.MAX_VALUE;
		int biggesty = Integer.MIN_VALUE;
		int biggestx = Integer.MIN_VALUE;

		for (int i = 0; i <= px.length - 1; i++) {
			if (px[i] < smallestx) {
				smallestx = px[i];
			}
		}
		for (int i = 0; i <= py.length - 1; i++) {
			if (py[i] < smallesty) {
				smallesty = py[i];
			}
		}
		for (int i = 0; i <= px.length - 1; i++) {
			if (px[i] > biggestx) {
				biggestx = px[i];
			}
		}
		for (int i = 0; i <= py.length - 1; i++) {
			if (py[i] > biggesty) {
				biggesty = py[i];
			}
		}

		Point p1 = new Point(smallestx, smallesty);
		Point p2 = new Point(biggestx, biggesty);

		return new Rectangle(p1, p2);
	}