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...")
 
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 ||
 
|}
 
|}
 +
 +
[[Categories:Trigonometric Functions]]

Revision as of 15:17, 4 October 2016

Function Returns Introduced Description
atan2 Float v5.1.0 Returns the radians angle of the specified x,y coordinatesBadge SHIPv5.gif

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

Categories:Trigonometric Functions