C4 Engine Terathon Software C4 Engine API Documentation

• Math Library

API Links
Developer Links

Math::DistanceLineToLine

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

float DistanceLineToLine(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 DistanceLineToLine function returns the distance of closest approach between the two lines defined by S1 + t · V1 and S2 + t · V2. If the lines are parallel, then the perpendicular distance between the lines is returned.
See Also

Math::DistancePointToLine

Math::SquaredDistanceLineToLine

Math::SquaredDistancePointToLine