Difference between revisions of "SHIP:Sail:atan2"

From Serious Documentation
Jump to: navigation, search
Line 46: Line 46:
 
|}
 
|}
  
[[Categories:Trigonometric Functions]]
+
[[Category:Trigonometric Functions]]

Revision as of 15:28, 10 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