C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Math::SquaredDistanceLineToLine

Defined in:  C4Computation.h
Calculates the squared distance between two lines.
Prototype

float SquaredDistanceLineToLine(const Point3D& s1, const Vector3D& v1, const Point3D& s2, const Vector3D& v2);

Parameters
s1 The origin S1 of the first line.
v1 The direction V1 of the first line.
s2 The origin S2 of the second line.
v2 The direction V2 of the second line.
Description
The SquaredDistanceLineToLine function returns the squared distance of closest approach between the two lines defined by S1 + t · V1 and S2 + t · V2. If the lines are parallel, then the squared perpendicular distance between the lines is returned.
See Also

Math::DistanceLineToLine

Math::DistancePointToLine

Math::SquaredDistancePointToLine