Vector/Distance

From Garry's Mod
Revision as of 21:04, 4 June 2019 by Zaros (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Vector:Distance( )

Contents

Description

Returns the pythagorean distance between the vector and the other vector.

WARNING

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

Arguments

Vector otherVector

The vector to get the distance to.

Returns

number

Distance between the vectors.

Examples

Example

Gets the distance from A to B.

print(Vector(0, 0, 0):Distance(Vector(2, 3, 4)))

Output:

5.3851647377014
Personal tools
Navigation