Class DistanceUtil


  • public class DistanceUtil
    extends java.lang.Object
    a class for performing distance calculations between different
    geometric primitives
    • Constructor Detail

      • DistanceUtil

        public DistanceUtil​(long cPtr,
                            boolean cMemoryOwn)
      • DistanceUtil

        public DistanceUtil()
    • Method Detail

      • getCPtr

        public static long getCPtr​(DistanceUtil obj)
      • delete

        public void delete()
      • distanceLineLineSqr

        public static double distanceLineLineSqr​(Vector3D p1,
                                                 Vector3D p2,
                                                 Vector3D q1,
                                                 Vector3D q2)
        computes the squared euclidean distance between line segments
        (line(p1,p2),line(q1,q2))
        Parameters:
        p1 - [in] start point on line segment 1
        p2 - [in] end point on line segment 1
        q1 - [in] start point on line segment 2
        q2 - [in] end point on line segment 2
        Returns:
        distance between line segments
      • distanceLineLine

        public static double distanceLineLine​(Vector3D p1,
                                              Vector3D p2,
                                              Vector3D q1,
                                              Vector3D q2)
        computes the euclidean distance between line segments (line(p1,p2),line(q1,q2))
        Parameters:
        p1 - [in] start point on line segment 1
        p2 - [in] end point on line segment 1
        q1 - [in] start point on line segment 2
        q2 - [in] end point on line segment 2
        Returns:
        distance between line segments