Difference between revisions of "SHIP:Sail:atan2"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|atan2}}||{{DataType|Float}}||style="text-align:center;"|v5.1.0||Returns the radians angle of the specified x,y coord...")
 
 
(2 intermediate revisions by the same user not shown)
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: ==
Line 7: Line 7:
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
 
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
*[[SHIP:Sail:Trigonomic Functions|Sail Trigonomic Functions]]
+
*[[SHIP:Sail:Trigonometric Functions|Sail Trigonometric Functions]]
  
 
== Prototype ==
 
== Prototype ==
Line 45: Line 45:
 
|<code>{{SailFunc|toDegrees}}({{SailFunc|atan2}}(1, 0));</code> || 90 ||
 
|<code>{{SailFunc|toDegrees}}({{SailFunc|atan2}}(1, 0));</code> || 90 ||
 
|}
 
|}
 +
 +
[[Category:Trigonometric Functions]]

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