# Vector/LengthSqr

From Garry's Mod

(Difference between revisions)

Robotboy655 (Talk | contribs) |
m (Format.) |
||

Line 2: | Line 2: | ||

|Name=LengthSqr | |Name=LengthSqr | ||

|Parent=Vector | |Parent=Vector | ||

− | |Description=Returns the squared length of the vector, | + | |Description=Returns the squared length of the vector, x² + y² + z². |

+ | |||

+ | This is faster than {{ClassFunction|Vector|Length}} as calculating the square root is an expensive process. | ||

|Realm=Shared | |Realm=Shared | ||

|IsClass=Yes | |IsClass=Yes |

## Latest revision as of 15:18, 2 February 2015

# Description

Returns the squared length of the vector, x² + y² + z².

This is faster than Vector:Length as calculating the square root is an expensive process.

# Returns

Squared length of the vector