Garry's Mod Wiki

math.Dist

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

Description

You should use math.Distance instead

Returns the difference between two points in 2D space. Alias of 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
Distance between the two points.

Example

Demonstrates the use of this function.

print( math.Distance( 1, 2, 5, 6 ) ) -- distance bet
Output: 5.6568542494924

Page Links


Special Pages


Wikis

?

Render Time: 20ms

Session 0
DB GetPage 3
Generate Html 3
Render Body 0
Render Sidebar 3