math.Dist
From GMod Wiki
(Redirected from Math.Distance)
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: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Math.Dist]Math.Dist [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Prints the distance between the points (1, 2) and (1, 7) |
---|---|
Used on | |
Code | print(math.Dist(1, 2, 1, 7)) |
Output | 5 |
Additional Notes
- Math.Distance is an alias for this function.
See Also
- None