Garry's Mod Wiki

Vector:Distance

number Vector:Distance( Vector otherVector )

Description

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

This function is more expensive than Vector:DistToSqr. However, please see the notes for Vector:DistToSqr before using it as squared distances are not the same as euclidean distances.

Arguments

1 Vector otherVector
The vector to get the distance to.

Returns

1 number
Distance between the vectors.

Example

Gets the distance from A to B.

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

Page Links


Special Pages


Wikis

?

Render Time: 67ms

DB GetPage 34
Generate Html 8
SaveChanges (1) 11
Render Body 0
Render Sidebar 11