Package javafx.geometry
Class GeometryUtil
java.lang.Object
javafx.geometry.GeometryUtil
- Author:
- Bruno Salmon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
angle
(double x, double y) Computes the angle (in degrees) between the vector and the X axisstatic double
angle
(double pivotX, double pivotY, double x, double y) Computes the angle (in degrees) between the vector and the X axisstatic double
angleRadian
(double x, double y) Computes the angle (in radian) between the vector and the X axisstatic double
distance
(double x, double y) Computes the length of the vector represented by invalid input: '{@code (x, y). @param x the X magnitude of the vector @param y the Y magnitude of the vector @return the length of the vector.'static double
distance
(double x1, double y1, double x2, double y2) Computes the distance between point 1 and point 2.static double
Computes the distance between point 1 and point 2.static double
Computes the distance between point 1 and point 2.static Point2D
pivot
(double pivotX, double pivotY, double angleDeg, double distance) static Point2D
pivotRadian
(double pivotX, double pivotY, double angleRad, double distance) static Point2D
rotate
(double pivotX, double pivotY, double x, double y, double angleDeg)
-
Constructor Details
-
GeometryUtil
public GeometryUtil()
-
-
Method Details
-
distance
public static double distance(double x, double y) Computes the length of the vector represented by invalid input: '{@code (x, y). @param x the X magnitude of the vector @param y the Y magnitude of the vector @return the length of the vector.' -
distance
public static double distance(double x1, double y1, double x2, double y2) Computes the distance between point 1 and point 2.- Parameters:
x1
- the x coordinate of point 1y1
- the y coordinate of point 1x2
- the x coordinate of point 2y2
- the y coordinate of point 2- Returns:
- the distance between point 1 and point 2.
-
distance
Computes the distance between point 1 and point 2.- Parameters:
point1
- x and y coordinate of point 1x2
- the x coordinate of point 2y2
- the y coordinate of point 2- Returns:
- the distance between point 1 and point 2.
-
distance
Computes the distance between point 1 and point 2.- Parameters:
point1
- x and y coordinate of point 1point2
- x and y coordinate of point 2- Returns:
- the distance between point 1 and point 2.
-
angleRadian
public static double angleRadian(double x, double y) Computes the angle (in radian) between the vector and the X axis- Parameters:
x
- the X magnitude of the vectory
- the Y magnitude of the vector- Returns:
- the angle (in radian) between the vector and the X axis
-
angle
public static double angle(double x, double y) Computes the angle (in degrees) between the vector and the X axis- Parameters:
x
- the X magnitude of the vectory
- the Y magnitude of the vector- Returns:
- the angle (in degrees) between the vector and the X axis
-
angle
public static double angle(double pivotX, double pivotY, double x, double y) Computes the angle (in degrees) between the vector and the X axis- Parameters:
x
- the X magnitude of the vectory
- the Y magnitude of the vector- Returns:
- the angle (in degrees) between the vector and the X axis
-
pivot
-
pivotRadian
-
rotate
-