main/src/georegression/metric/ClosestPoint3D_F64.java
public static Point3D_F64 closestPoint( Point3D_F64 vertexA, Point3D_F64 vertexB, Point3D_F64 vertexC,
											Point3D_F64 point , Point3D_F64 ret) {

		if( ret == null ) {
			ret = new Point3D_F64();
		}

		DistancePointTriangle3D_F64 alg = new DistancePointTriangle3D_F64();
		alg.setTriangle(vertexA,vertexB,vertexC);

		alg.closestPoint(point,ret);

		return ret;
	}
public static Point3D_F64 closestPoint( Point3D_F64 vertexA, Point3D_F64 vertexB, Point3D_F64 vertexC,
											Point3D_F64 point , Point3D_F64 ret) {

		if( ret == null ) {
			ret = new Point3D_F64();
		}

		DistancePointTriangle3D_F64 alg = new DistancePointTriangle3D_F64();
		alg.setTriangle(vertexA,vertexB,vertexC);

		alg.closestPoint(point,ret);

		return ret;
	}
Closest point from a 3D triangle to a point.

@see DistancePointTriangle3D_F64

@param vertexA Vertex in a 3D triangle.
@param vertexB Vertex in a 3D triangle.
@param vertexC Vertex in a 3D triangle.
@param point Point for which the closest point on the triangle is found
@param ret (Optional) Storage for the solution.  If null is passed in a new point is created. Modified.
@return The closest point