Difference between revisions of "SHIP:Sail:atan2"

From Serious Documentation
Jump to: navigation, search
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|atan2}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Returns the radians angle of the specified x,y coordinates{{v5}}</onlyinclude>
+
|{{SailFunc|atan2}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Calculates the radian angle of the specified x,y coordinates</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==

Latest revision as of 11:42, 14 October 2016

Function Returns Introduced Description
atan2 Float v5.1.0 Calculates the radian angle of the specified x,y coordinates

See Also:

Prototype

Float atan2(Float y, Float x);

Parameters/Return Value

Parameter Data Type Description
y Float the y coordinate to take the arctan of
x Float the x coordinate to take the arctan of
Return Float atan2(y, x)

Detailed Description

The atan() function returns the arctan of the supplied value in radians. If you want to return an angle in degrees you can use toDegrees(atan2(y, x))

Examples

Example Result Notes
toDegrees(atan2(-1, -1)); -135
toDegrees(atan2(1, 1)); 45
toDegrees(atan2(0.5f, 2.4f)); 12
toDegrees(atan2(1, 0)); 90