Difference between revisions of "Math.normalize"

From GiderosMobile
(removed language stuff)
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>Normalize a vector.</translate>
+
Normalize a vector.
 
<source lang="lua">
 
<source lang="lua">
 
(number),(number),(number) = math.normalize(x,y,z)
 
(number),(number),(number) = math.normalize(x,y,z)
Line 11: Line 11:
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''x''': (number) <translate>X component of the vector</translate> <br/>
+
'''x''': (number) X component of the vector<br/>
'''y''': (number) <translate>Y component of the vector</translate> <br/>
+
'''y''': (number) Y component of the vector<br/>
'''z''': (number) <translate>Z component of the vector</translate> '''optional''' <br/>
+
'''z''': (number) Z component of the vector '''optional'''<br/>
  
=== <translate>Return values</translate> ===
+
=== Return values ===
'''<translate>Returns</translate>''' (number) <translate>the normalized vector</translate><br/>
+
'''Returns''' (number) the normalized vector<br/>
  
 
{{Math}}
 
{{Math}}

Revision as of 16:58, 16 June 2021

Available since: Gideros 2020.9
Class: math

Description

Normalize a vector.

(number),(number),(number) = math.normalize(x,y,z)
(table) = math.normalize({x,y,z})
(table) = math.normalize({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 normalized vector