SquareOfLineSegmentsDistance

From Solid Graphics Wiki

Jump to: navigation, search
SquareOfLineSegmentsDistance
Namespace: SKL3D
Member of: (this function is not member of any class)
Include: Skl3DMath.h
Lib (Release): SKL.lib
Lib (Debug): SKL_D.lib

The SquareOfLineSegmentsDistance function returns square of shortest distance between two line segments.

float SquareOfLineSegmentsDistance
         (
         const float P0[ 3 ],
         const float P1[ 3 ],
         const float Q0[ 3 ],
         const float Q1[ 3 ],
         float C[ 3 ]
         );
double SquareOfLineSegmentsDistance
         (
         const double P0[ 3 ],
         const double P1[ 3 ],
         const double Q0[ 3 ],
         const double Q1[ 3 ],
         double C[ 3 ]
         );


Parameters

P0 x,y,z coordinates of first point defining the first line segment
P1 x,y,z coordinates of second point defining the first line segment
Q0 x,y,z coordinates of first point defining the second line segment
Q1 x,y,z coordinates of second point defining the second line segment
C the function stores x,y,z coordinates of the closest point from the first line segment to the variable pointed by C

Return Value

The square of shortest distance of the two line segments.

See Also


   


SolidKit Library Documentation

Personal tools