public class GeometryUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Point2d |
ClosestPointOnLineSegment(Point2d p0,
Point2d p1,
Point2d pt)
Find the point on a line segment closest to the given point.
|
static double |
ClosestPointToPolygon(Point2d[] pts,
Point2d pt,
Point2d retClosePt)
Find the closest point on the polygon to the point passed in
|
static boolean |
PointInPolygon(Point2d pt,
Point2d[] ring)
Test if the given point is inside the given polygon in 2D.
|
public static boolean PointInPolygon(Point2d pt, Point2d[] ring)
pt
- Point we're testingpoly
- Polygon we're testingpublic static Point2d ClosestPointOnLineSegment(Point2d p0, Point2d p1, Point2d pt)
p0
- First point in the line segment.p1
- Second point in the line segment.pt
- Point near the line segment.public static double ClosestPointToPolygon(Point2d[] pts, Point2d pt, Point2d retClosePt)
pts
- Polygon we're testing against.pt
- Point that's near the polygon.retClosePt
- The closest point on the polygon to the input pt.