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

Provides various 2D vector utility methods.

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


 C#  Visual Basic  Visual C++ 
public static class Vector2Util
Public NotInheritable Class Vector2Util
public ref class Vector2Util abstract sealed


 All Members  Properties   Methods  



 XNA Framework Only 

 .NET Compact Framework Only 

Dot(Vector2, Vector2)
Returns the dot product of the specified vectors. (u . v)
GetDirectionAB(Vector2, Vector2)
Derives the normalized direction vector from point A to point B. (Costly method!)
GetDistanceSq(Vector2, Vector2)
Returns the square of the distance between two points.
Normalizes the specified vector such that its length is equal to one. (Costly method!)
ScaleTo(Vector2, Single)
Scales the vector to the specified length. (Costly method!)
SloppyEquals(Vector2, Vector2, Single)
Determines whether or not the specified vectors are equal within the specified tolerance.
TruncateLength(Vector2, Single)
Truncates the length of the vector to the specified value.
The zero vector. (0, 0)


Static methods are thread safe.

Inheritance Hierarchy


See Also