GetDistance2D: Difference between revisions
From Onset Developer Wiki
X7airworker (talk | contribs) No edit summary |
FlyingFork (talk | contribs) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local distance = GetDistance2D(0, 0, 100, 100) -- Returns 100 | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
[[GetDistance3D]] | * [[GetDistance3D]] | ||
[[GetDistanceSquared3D]] | * [[GetDistanceSquared3D]] |
Latest revision as of 16:00, 2 August 2021
Description
Calculates the distance between 2 points.
Syntax
GetDistance2D(x, y, x2, y2)
Parameters
- x
x of the first point. - y
y of the first point. - x2
x of the second point. - y2
y of the second point.
Return Value
- The distance between the 2 points.
Example
local distance = GetDistance2D(0, 0, 100, 100) -- Returns 100