Unofficial LSL Reference

[[functions:llatan2]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llatan2 [2014-12-09 16:44 SLT]
sei Add nav
functions:llatan2 [2015-09-23 14:38 SLT] (current)
sei Style
Line 18: Line 18:
 ===== Return value ===== ===== Return value =====
  
-[[types/Float]] number with the angle of the vector.+$lty[Float] number with the angle of the vector.
  
 ===== Notes ===== ===== Notes =====
  
   * If both components are zero, the result is zero.   * If both components are zero, the result is zero.
-  * The result is always between -[[constants/PI]] and **PI**, except if one of the inputs is **NaN**, in which case it returns ​**NaN** ​as well. +  * The result is always between -$lct[PI] and $ct[PI], except if one of the inputs is $nan, in which case it returns ​$nan as well. 
-  * This function distinguishes zero and minus zero, in that e.g. llAtan2(-0.0,​ -1) gives **-PI**, not **PI**.+  * This function distinguishes zero and minus zero, in that e.g. llAtan2(-0.0,​ -1) gives -$ct[PI], not $ct[PI].
   * The name and order of parameters of this function come from the fact that the angle of a 2D vector with a nonzero x coordinate is given by the arctangent (inverse tangent) of y/x. The order y, x is customarily used in many programming languages.   * The name and order of parameters of this function come from the fact that the angle of a 2D vector with a nonzero x coordinate is given by the arctangent (inverse tangent) of y/x. The order y, x is customarily used in many programming languages.
-  * The convention in navigation is that zero degrees is North (or forward, if expressing a relative angle), and the angle grows clockwise, so 90 degrees is East (or right), and so on. This differs from the convention in mathematics,​ where zero degrees is East, etc. To use the navigation convention, only "​un-inverting"​ x and y is needed, e.g. llAtan2(1, 2) is the angle of the vector (1, 2) expressed with this convention.+  * The convention in navigation is that zero degrees is North (or forward, if expressing a relative angle), and the angle grows clockwise, so 90 degrees is East (or right), and so on. This differs from the convention in mathematics,​ where zero degrees is East, etc. To use the navigation convention, only "​un-inverting"​ x and y is needed, e.g. ''​llAtan2(1, 2)'' ​is the angle of the vector (1, 2) expressed with this convention.
  
 ===== Short examples ===== ===== Short examples =====
Line 61: Line 61:
 ===== See also ===== ===== See also =====
  
-=== Related trigonometric functions === +  ​$lfn[llTan] calculates the tangent of the argument. 
-  ​[[llTan]] calculates the tangent of the argument. +  * $lfn[llAsin] calculates the inverse sine of the argument. 
- +  * $lfn[llSin] calculates the sine of the argument. 
-=== Other trigonometric functions === +  * $lfn[llAcos] calculates the inverse cosine of the argument. 
-  * [[llAsin]] calculates the inverse sine of the argument. +  * $lfn[llCos] calculates the cosine of the argument. 
-  * [[llSin]] calculates the sine of the argument. +  * $lfn[llAngleBetween] calculates the angle between two rotations. 
-  * [[llAcos]] calculates the inverse cosine of the argument. +  * $lfn[llRot2Angle] takes the angle part of a $lty[rotation]. 
-  * [[llCos]] calculates the cosine of the argument. +  * Other $lfn[math/] functions.
- +
-=== Other functions to obtain angles === +
-  * [[llAngleBetween]] calculates the angle between two rotations. +
-  * [[llRot2Angle]] takes the angle part of a [[types/rotation]]. +