Difference between revisions of "Math.length"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2020.9<br/>
'''<translate>Available since</translate>:''' Gideros 2020.9<br/>
+
'''Class:''' [[math]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/math|math]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Returns the length of a vector.</translate>
+
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>
=== <translate>Parameters</translate> ===
+
 
'''x''': (number) <translate>X component of the vector</translate> <br/>
+
=== Parameters ===
'''y''': (number) <translate>Y component of the vector</translate> <br/>
+
'''x''': (number) x component of the vector<br/>
'''z''': (number) '''optional''' <translate>Z component of the vector</translate> <br/>
+
'''y''': (number) y component of the vector<br/>
 +
'''z''': (number) z component of the vector '''optional'''<br/>
  
=== <translate>Return values</translate> ===
+
=== Return values ===
'''<translate>Returns</translate>''' (number) <translate>the length of the vector</translate><br/>
+
'''Returns''' (number) the length of the vector<br/>
  
 
{{Math}}
 
{{Math}}

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