Difference between revisions of "Math.length"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
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})

Revision as of 15:28, 13 July 2023

Available since: Gideros 2020.9
Class: math

Description

Returns the length of a vector. <syntaxhighlight lang="lua"> (number) = math.length(x,y,z) (number) = math.length({x,y,z}) (number) = math.length({x=x,y=y,z=z}) </source>

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