georegression.metric
Class ClosestPoint3D_F64
- java.lang.Object
-
- georegression.metric.ClosestPoint3D_F64
-
public class ClosestPoint3D_F64 extends java.lang.ObjectFunctions related to finding the closest point(s) on one shape from another shape.
-
-
Constructor Summary
Constructors Constructor and Description ClosestPoint3D_F64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Point3D_F64closestPoint(LineParametric3D_F64 l0, LineParametric3D_F64 l1, Point3D_F64 ret)Returns the point which minimizes the distance between the two lines in 3D.static doubleclosestPoint(LineParametric3D_F64 line, Point3D_F64 pt)Finds the closest point on a line to the specified point as a function of distance along the line.static Point3D_F64closestPoint(LineParametric3D_F64 line, Point3D_F64 pt, Point3D_F64 ret)Finds the closest point on a line to the specified point.static Point3D_F64closestPoint(LineSegment3D_F64 l0, LineSegment3D_F64 l1, Point3D_F64 ret)Find the point which minimizes its distance from the two line segments.static Point3D_F64closestPoint(LineSegment3D_F64 line, Point3D_F64 pt, Point3D_F64 ret)Finds the closest point on a line segment to the specified point.static Point3D_F64closestPoint(PlaneGeneral3D_F64 plane, Point3D_F64 point, Point3D_F64 found)Finds the closest point on the plane to the specified point.static Point3D_F64closestPoint(PlaneNormal3D_F64 plane, Point3D_F64 point, Point3D_F64 found)Finds the closest point on the plane to the specified point.static Point3D_F64closestPoint(Point3D_F64 vertexA, Point3D_F64 vertexB, Point3D_F64 vertexC, Point3D_F64 point, Point3D_F64 ret)Closest point from a 3D triangle to a point.static Point3D_F64closestPointOrigin(PlaneGeneral3D_F64 plane, Point3D_F64 found)Finds the closest point on the plane to the origin.static booleanclosestPoints(LineParametric3D_F64 l0, LineParametric3D_F64 l1, double[] param)Finds the closest point on line lo to l1 and on l1 to l0.static doubleclosestPointT(LineParametric3D_F64 line, PlaneNormal3D_F64 plane)Computes the closest point along the line to the plane as a function of 't':
[x, y, z] = [x_0, y_0, z_0] + t·[slopeX, slopeY, slopZ]
-
-
-
Method Detail
-
closestPoint
public static Point3D_F64 closestPoint(LineParametric3D_F64 l0, LineParametric3D_F64 l1, Point3D_F64 ret)
Returns the point which minimizes the distance between the two lines in 3D. If the two lines are parallel the result is undefined.- Parameters:
l0- first line. Not modified.l1- second line. Not modified.ret- (Optional) Storage for the closest point. If null a new point is declared. Modified.- Returns:
- Closest point between two lines.
-
closestPoints
public static boolean closestPoints(LineParametric3D_F64 l0, LineParametric3D_F64 l1, double[] param)
Finds the closest point on line lo to l1 and on l1 to l0. The solution is returned in 'param' as a value of 't' for each line.
point on l0 = l0.a + param[0]*l0.slope
point on l1 = l1.a + param[1]*l1.slope- Parameters:
l0- first line. Not modified.l1- second line. Not modified.param- param[0] for line0 location and param[1] for line1 location.- Returns:
- False if the lines are parallel or true if a solution was found.
-
closestPoint
public static Point3D_F64 closestPoint(LineParametric3D_F64 line, Point3D_F64 pt, Point3D_F64 ret)
Finds the closest point on a line to the specified point.- Parameters:
line- Line on which the closest point is being found. Not modified.pt- The point whose closest point is being looked for. Not modified.ret- Storage for the solution. Can be same as instance as 'pt'. If null is passed in a new point is created. Modified.
-
closestPoint
public static double closestPoint(LineParametric3D_F64 line, Point3D_F64 pt)
Finds the closest point on a line to the specified point as a function of distance along the line. The 3D coordinate of the point at 'd', the returned value, is P = (x,y,z) + (slope.x,slope.y,slope.z)*d.- Parameters:
line- Line on which the closest point is being found. Not modified.pt- The point whose closest point is being looked for. Not modified.- Returns:
- The location 'd' along the line of the closeset point
-
closestPoint
public static Point3D_F64 closestPoint(PlaneNormal3D_F64 plane, Point3D_F64 point, Point3D_F64 found)
Finds the closest point on the plane to the specified point.- Parameters:
plane- The planepoint- The pointfound- (Optional) Storage for the closest point. If null a new point is declared internally.- Returns:
- The closest point
-
closestPoint
public static Point3D_F64 closestPoint(PlaneGeneral3D_F64 plane, Point3D_F64 point, Point3D_F64 found)
Finds the closest point on the plane to the specified point.- Parameters:
plane- The planepoint- The pointfound- (Optional) Storage for the closest point. Can be same as instance as 'pt'. If null a new point is declared internally.- Returns:
- The closest point
-
closestPointOrigin
public static Point3D_F64 closestPointOrigin(PlaneGeneral3D_F64 plane, Point3D_F64 found)
Finds the closest point on the plane to the origin.- Parameters:
plane- The planefound- (Optional) Storage for the closest point. Can be same as instance as 'pt'. If null a new point is declared internally.- Returns:
- The closest point
-
closestPoint
public static Point3D_F64 closestPoint(LineSegment3D_F64 line, Point3D_F64 pt, Point3D_F64 ret)
Finds the closest point on a line segment to the specified point.- Parameters:
line- Line on which the closest point is being found. Not modified.pt- The point whose closest point is being looked for. Not modified.ret- (Optional) Storage for the solution. Can be same as instance as 'pt'. If null is passed in a new point is created. Modified.- Returns:
- The closest point
-
closestPoint
public static Point3D_F64 closestPoint(LineSegment3D_F64 l0, LineSegment3D_F64 l1, Point3D_F64 ret)
Find the point which minimizes its distance from the two line segments.- Parameters:
l0- First line. Not modified.l1- Second line. Not modified.ret- (Optional) Storage for the solution. Can be same as instance as 'pt'. If null is passed in a new point is created. Modified.- Returns:
- The closest point
-
closestPoint
public static Point3D_F64 closestPoint(Point3D_F64 vertexA, Point3D_F64 vertexB, Point3D_F64 vertexC, Point3D_F64 point, Point3D_F64 ret)
Closest point from a 3D triangle to a point.- Parameters:
vertexA- Vertex in a 3D triangle.vertexB- Vertex in a 3D triangle.vertexC- Vertex in a 3D triangle.point- Point for which the closest point on the triangle is foundret- (Optional) Storage for the solution. If null is passed in a new point is created. Modified.- Returns:
- The closest point
- See Also:
DistancePointTriangle3D_F64
-
closestPointT
public static double closestPointT(LineParametric3D_F64 line, PlaneNormal3D_F64 plane)
Computes the closest point along the line to the plane as a function of 't':
If there is no intersection then Double.NaN is returned.
[x, y, z] = [x_0, y_0, z_0] + t·[slopeX, slopeY, slopZ]- Parameters:
line- The line along which the closest point is being found. Not modified.plane- Plane being checked for intersection- Returns:
- Distance as a function of 't'. NaN if there is no intersection.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG