Garry's Mod Wiki

math.DistanceSqr

  number math.DistanceSqr( number x1, number y1, number x2, number y2 )

Description

Returns the squared difference between two points in 2D space. This is computationally faster than math.Distance.

Arguments

1 number x1
X position of first point
2 number y1
Y position of first point
3 number x2
X position of second point
4 number y2
Y position of second point

Returns

1 number
The squared distance between the two points.