public Point2D testRotationHandle(double x, double y, Shape selected,
			double scale) {

		Point2D point = Transformation.worldToObject(selected, x, y);
		x = point.getX();
		y = point.getY();

		if (selected instanceof Square) {

			Square square = (Square) selected;

			if ((x) * (x) + (y + square.getSize() * 3 / 4)
					* (y + square.getSize() * 3 / 4) <= (3 / scale)
					* (3 / scale)) {
				return new Point2D.Double(selected.getX(), selected.getY()
						- square.getSize() * 3 / 4);
			}
		} else if (selected instanceof Rectangle) {

			Rectangle rectangle = (Rectangle) selected;

			if ((x) * (x) + (y + rectangle.getHeight() * 3 / 4)
					* (y + rectangle.getHeight() * 3 / 4) <= (3 / scale)
					* (3 / scale)) {
				return new Point2D.Double(selected.getX(), selected.getY()
						- rectangle.getHeight() * 3 / 4);
			}
		} else if (selected instanceof Ellipse) {

			Ellipse ellipse = (Ellipse) selected;

			if ((x) * (x) + (y + ellipse.getHeight() * 3 / 4)
					* (y + ellipse.getHeight() * 3 / 4) <= (3 / scale)
					* (3 / scale)) {
				return new Point2D.Double(selected.getX(), selected.getY()
						- ellipse.getHeight() * 3 / 4);
			}
		} else if (selected instanceof Triangle) {

			Triangle triangle = (Triangle) selected;

			if ((x)
					* (x)
					+ (y - Math.min(triangle.getY1(),
							Math.min(triangle.getY2(), triangle.getY3())) * 3 / 2)
					* (y - Math.min(triangle.getY1(),
							Math.min(triangle.getY2(), triangle.getY3())) * 3 / 2) <= (3 / scale)
					* (3 / scale)) {
				return new Point2D.Double(selected.getX()
						+ Math.min(triangle.getY1(),
								Math.min(triangle.getY2(), triangle.getY3())),
						selected.getY()
								+ Math.min(
										triangle.getY1(),
										Math.min(triangle.getY2(),
												triangle.getY3())));
			}
		}

		return null;
	}