georegression.metric
Class Distance2D_F32
- java.lang.Object
-
- georegression.metric.Distance2D_F32
-
public class Distance2D_F32 extends java.lang.ObjectFunctions related to finding the distance of one shape from another shape. This is often closely related to finding theclosest point.
-
-
Constructor Summary
Constructors Constructor and Description Distance2D_F32()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static floatdistance(LineGeneral2D_F32 line, Point2D_F32 p)Returns the Euclidean distance of the closest point on the line to the specified point.static floatdistance(LineParametric2D_F32 line, Point2D_F32 p)Returns the Euclidean distance of the closest point on the line from a point.static floatdistance(LineSegment2D_F32 segmentA, LineSegment2D_F32 segmentB)Finds the distance between the two line segmentsstatic floatdistance(LineSegment2D_F32 line, Point2D_F32 p)Returns the Euclidean distance of the closest point on a line segment to the specified point.static floatdistance(Polygon2D_F32 poly, Point2D_F32 p)Returns the Euclidean distance of the closest point on the Polygon to the provided point.static floatdistance(Quadrilateral_F32 quad, Point2D_F32 p)Returns the Euclidean distance of the closest point on the quadrilateral to the provided point.static floatdistanceNorm(LineGeneral2D_F32 line, Point2D_F32 p)Returns the signed Euclidean distance of the closest point on the line to the specified point.static floatdistanceOrigin(LineParametric2D_F32 line)Returns the distance of the closest point on the line from the originstatic floatdistanceSq(LineParametric2D_F32 line, Point2D_F32 p)Returns the Euclidean distance squared of the closest point on the line from a point.static floatdistanceSq(LineSegment2D_F32 segmentA, LineSegment2D_F32 segmentB)Finds the distance squared between the two line segmentsstatic floatdistanceSq(LineSegment2D_F32 line, Point2D_F32 p)Returns the Euclidean distance squared of the closest point on a line segment to the specified point.static floatdistanceSq(Polygon2D_F32 poly, Point2D_F32 p, LineSegment2D_F32 storage)Returns the Euclidean distance squared of the closest point on the Polygon to the provided point.static floatdistanceSq(Quadrilateral_F32 quad, Point2D_F32 p)Returns the Euclidean distance squared of the closest point on the quadrilateral to the provided point.
-
-
-
Method Detail
-
distance
public static float distance(LineParametric2D_F32 line, Point2D_F32 p)
Returns the Euclidean distance of the closest point on the line from a point.
- Parameters:
line- A line segment. Not modified.p- The point. Not modified.- Returns:
- Distance the closest point on the line is away from the point.
-
distanceSq
public static float distanceSq(LineParametric2D_F32 line, Point2D_F32 p)
Returns the Euclidean distance squared of the closest point on the line from a point.
- Parameters:
line- A line segment. Not modified.p- The point. Not modified.- Returns:
- Euclidean distance squared to the closest point on the line is away from the point.
-
distance
public static float distance(LineSegment2D_F32 line, Point2D_F32 p)
Returns the Euclidean distance of the closest point on a line segment to the specified point.
- Parameters:
line- A line segment. Not modified.p- The point. Not modified.- Returns:
- Euclidean distance of the closest point on a line is away from a point.
-
distanceSq
public static float distanceSq(LineSegment2D_F32 line, Point2D_F32 p)
Returns the Euclidean distance squared of the closest point on a line segment to the specified point.
- Parameters:
line- A line segment. Not modified.p- The point. Not modified.- Returns:
- Euclidean distance squared of the closest point on a line is away from a point.
-
distance
public static float distance(LineSegment2D_F32 segmentA, LineSegment2D_F32 segmentB)
Finds the distance between the two line segments- Parameters:
segmentA- Line segment. Not modified.segmentB- Line segment. Not modified.- Returns:
- Euclidean distance of the closest point between the two line segments.
-
distanceSq
public static float distanceSq(LineSegment2D_F32 segmentA, LineSegment2D_F32 segmentB)
Finds the distance squared between the two line segments- Parameters:
segmentA- Line segment. Not modified.segmentB- Line segment. Not modified.- Returns:
- Euclidean distance squared of the closest point between the two line segments.
-
distance
public static float distance(Quadrilateral_F32 quad, Point2D_F32 p)
Returns the Euclidean distance of the closest point on the quadrilateral to the provided point.- Parameters:
quad- Quadrilateralp- Point- Returns:
- Distance apart
-
distanceSq
public static float distanceSq(Quadrilateral_F32 quad, Point2D_F32 p)
Returns the Euclidean distance squared of the closest point on the quadrilateral to the provided point.- Parameters:
quad- Quadrilateralp- Point- Returns:
- Distance squared apart
-
distance
public static float distance(Polygon2D_F32 poly, Point2D_F32 p)
Returns the Euclidean distance of the closest point on the Polygon to the provided point.- Parameters:
poly- Polygon2Dp- Point- Returns:
- Distance squared apart
-
distanceSq
public static float distanceSq(Polygon2D_F32 poly, Point2D_F32 p, LineSegment2D_F32 storage)
Returns the Euclidean distance squared of the closest point on the Polygon to the provided point.- Parameters:
poly- Polygon2Dp- Pointstorage- Optional storage for linesegment which is used internally to compute the distance- Returns:
- Distance squared apart
-
distance
public static float distance(LineGeneral2D_F32 line, Point2D_F32 p)
Returns the Euclidean distance of the closest point on the line to the specified point.
- Parameters:
line- A line. Not modified.p- The point. Not modified.- Returns:
- Euclidean distance of the closest point on the line to the specified point.
-
distanceNorm
public static float distanceNorm(LineGeneral2D_F32 line, Point2D_F32 p)
Returns the signed Euclidean distance of the closest point on the line to the specified point. The line is assumed be normalized. See
LineGeneral2D_F32for details on normalization.- Parameters:
line- A normalized line. Not modified.p- The point. Not modified.- Returns:
- Euclidean distance of the closest point on the line to the specified point.
-
distanceOrigin
public static float distanceOrigin(LineParametric2D_F32 line)
Returns the distance of the closest point on the line from the origin- Parameters:
line- Line- Returns:
- Euclidean distance
-
-
DataMelt 3.0 © DataMelt by jWork.ORG