Class GeometryUtil
- java.lang.Object
-
- org.uberfire.ext.wires.core.client.util.GeometryUtil
-
public class GeometryUtil extends Object
Useful geometry functions taken from Java's Line2D class
-
-
Constructor Summary
Constructors Constructor Description GeometryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleptSegDistSq(double x1, double y1, double x2, double y2, double px, double py)Returns the square of the distance from a point to a line segment.
-
-
-
Method Detail
-
ptSegDistSq
public static double ptSegDistSq(double x1, double y1, double x2, double y2, double px, double py)Returns the square of the distance from a point to a line segment. The distance measured is the distance between the specified point and the closest point between the specified end points. If the specified point intersects the line segment in between the end points, this method returns 0.0.See http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Line2D.html#ptSegDist%28double,%20double,%20double,%20double,%20double,%20double%29
- Parameters:
x1- the X coordinate of the start point of the specified line segmenty1- the Y coordinate of the start point of the specified line segmentx2- the X coordinate of the end point of the specified line segmenty2- the Y coordinate of the end point of the specified line segmentpx- the X coordinate of the specified point being measured against the specified line segmentpy- the Y coordinate of the specified point being measured against the specified line segment- Returns:
- a double value that is the square of the distance from the specified point to the specified line segment.
-
-