Garry's Mod Wiki


  number Vector:Distance2DSqr( Vector otherVec )


Returns the squared distance between 2 vectors in 2D space, ignoring the Z axis. This is faster than Vector:Distance2D as calculating the square root is an expensive process.

Squared distances should not be summed. If you need to sum distances, use Vector:Distance2D.

When performing a distance check, ensure the distance being checked against is squared.


1 Vector otherVec
The vector to calculate the distance to.


1 number
Squared distance to the vector in 2D space.