math.Dist

From GMod Wiki

(Redirected from Math.Distance)
Jump to: navigation, search
Function
Syntax math.Dist( Float x1, Float y1, Float x2, Float y2 )
Where is this used?
Description:
Calculates the distance from (x1,y1) to (x2,y2) in 2D.
Returns: Float
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.Dist]Math.Dist [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionPrints the distance between the points (1, 2) and (1, 7)
Used onNewerShared.png
Code
print(math.Dist(1, 2, 1, 7))
Output5


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox