atan: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 28: Line 28:
Using '''atan''' x is fine if you can be certain that x is a finite number.  For example:<br>
Using '''atan''' x is fine if you can be certain that x is a finite number.  For example:<br>
_angle = '''atan''' 1/0<br>
_angle = '''atan''' 1/0<br>
will create a divide by zero error, even though the angle is valid.<br>
will create a divide by zero error, even though the angle is 90.<br>
Better is to use [[atan2]]
Better is to use [[atan2]]

Revision as of 17:44, 21 May 2006


atan x


Operand types:

x: Number

Type of returned value:

Number

Description:

Arctangens of x, result in degrees.


Example:

_angle = atan 1 ..........Result is 45

Notes:
Using atan x is fine if you can be certain that x is a finite number. For example:
_angle = atan 1/0
will create a divide by zero error, even though the angle is 90.
Better is to use atan2