[This is preliminary documentation and is subject to change.]

Returns the distance squared from point P to the nearest point on line AB.

Namespace: org.critterai.geom
Assembly: cai-util (in cai-util.dll) Version: 0.5.0.0 (0.5.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public static float GetPointLineDistanceSq(
	Vector2 p,
	Vector2 a,
	Vector2 b
)
Public Shared Function GetPointLineDistanceSq ( _
	p As Vector2, _
	a As Vector2, _
	b As Vector2 _
) As Single
public:
static float GetPointLineDistanceSq(
	Vector2 p, 
	Vector2 a, 
	Vector2 b
)

Parameters

p
Vector2
The point.
a
Vector2
Point A on line AB.
b
Vector2
Point B on line AB.

Return Value

The distance squared from the point to line AB.

See Also