math/Dist

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
m (Grammar fixes, link to the math.Distance. (This function should really be removed...))
Line 2: Line 2:
 
|Name=Dist
 
|Name=Dist
 
|Parent=math
 
|Parent=math
|Description=Returns the difference between two points in 2D space
+
|Description=Returns the difference between two points in 2D space. Same as {{LibraryFunction|math|Distance}}
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=No
 
|IsClass=No
Line 28: Line 28:
 
{{Ret
 
{{Ret
 
|type=number
 
|type=number
|desc=Distance
+
|desc=Distance between the two points.
 
}}
 
}}
 
{{Example
 
{{Example

Revision as of 22:37, 17 March 2014

 math.Dist( )

Contents

Description

Returns the difference between two points in 2D space. Same as math.Distance

Arguments

number x1

X position of first point

Arguments

number y1

Y position of first point

Arguments

number x2

X position of second point

Arguments

number y2

Y position of second point

Returns

number

Distance between the two points.

Examples

Example

Demonstrates the use of this function.

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

Output:

5.6568542494924
Personal tools
Navigation