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

Returns the normalized vector that is perpendicular to line AB. (Costly method!)

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 Vector2 GetNormalAB(
	Vector2 a,
	Vector2 b
)
Public Shared Function GetNormalAB ( _
	a As Vector2, _
	b As Vector2 _
) As Vector2
public:
static Vector2 GetNormalAB(
	Vector2 a, 
	Vector2 b
)

Parameters

a
Vector2
Point A on line AB.
b
Vector2
Point B on line AB.

Return Value

The normalized vector that is perpendicular to line AB, or a zero length vector if the points are collocated.

Remarks

The direction of the vector will be to the right when viewed from point A to point B along the line.

Special Case: A zero length vector will be returned if the points are collocated.

See Also