public class Point2DUtil extends java.lang.Object
Constructor and Description |
---|
Point2DUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areConnected(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Test if the 2 specified points are
connected . |
static double |
getDistance(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Returns the distance between 2 points.
|
static double |
getDistance(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2,
double factorX,
double factorY)
Returns the distance between 2 points using specified scale factor for x/y dimension.
|
static double |
getL1Distance(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Returns the L1 distance between 2 points
|
static double |
getSquareDistance(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Returns the square of the distance between 2 points.
|
static double |
getTotalDistance(java.util.List<java.awt.geom.Point2D> points,
double factorX,
double factorY,
boolean connectLastPoint)
Returns the total distance of the specified list of points.
|
public Point2DUtil()
public static boolean areConnected(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
connected
.public static double getL1Distance(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
public static double getSquareDistance(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
public static double getDistance(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
public static double getDistance(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2, double factorX, double factorY)
public static double getTotalDistance(java.util.List<java.awt.geom.Point2D> points, double factorX, double factorY, boolean connectLastPoint)