Difference between revisions of "Math.atan2"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Returns the arc tangent of v1/v2 (in radians), but uses the signs of both parameters to find the quadr...")
 
Line 4: Line 4:
 
Returns the arc tangent of v1/v2 (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of v2 being zero.)
 
Returns the arc tangent of v1/v2 (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of v2 being zero.)
 
<source lang="lua">
 
<source lang="lua">
(number), = math.atan2(v1v2,)
+
(number) = math.atan2(v1,v2)
 
</source>
 
</source>
'''v1:''' (number) first value ''''''<br/>
+
'''v1''': (number) first value ''''''<br/>
'''v2:''' (number) second value ''''''<br/>
+
'''v2''': (number) second value ''''''<br/>
 
'''Returns''' (number) result<br/>
 
'''Returns''' (number) result<br/>

Revision as of 11:21, 23 August 2018

Available since: Gideros 2011.6

Description

Returns the arc tangent of v1/v2 (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of v2 being zero.)

(number) = math.atan2(v1,v2)

'v1: (number) first value '
'v2: (number) second value '
Returns (number) result