Garry's Mod Wiki

Garry's Mod Wiki

  number Vector:Length()

Description

Returns the Euclidean length of the vector: √(x² + y² + z²).

This is a relatively expensive process since it uses the square root. It is recommended that you use Vector:LengthSqr whenever possible.

Returns

1 number
Length of the vector.

Example

Gets the length of the vector.

print( Vector( 15, 16, 17 ):Length() )
Output:
27.748874664307

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...