Difference between revisions of "Math.length"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Returns the length of a vector.
 
Returns the length of a vector.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = math.length(x,y,z)
 
(number) = math.length(x,y,z)
 
(number) = math.length({x,y,z})
 
(number) = math.length({x,y,z})
 
(number) = math.length({x=x,y=y,z=z})
 
(number) = math.length({x=x,y=y,z=z})
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===

Latest revision as of 14:30, 13 July 2023

Available since: Gideros 2020.9
Class: math

Description

Returns the length of a vector.

(number) = math.length(x,y,z)
(number) = math.length({x,y,z})
(number) = math.length({x=x,y=y,z=z})

Parameters

x: (number) x component of the vector
y: (number) y component of the vector
z: (number) z component of the vector optional

Return values

Returns (number) the length of the vector