Core Function ATan2
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> ATan2( <expression>, <expression2> ) </pre> === Description === Compute arc tangent with two parameters. === Parameters === ==== expression ==== Any valid numeric expr...") |
(→Example) |
||
Line 31: | Line 31: | ||
$y = 10.0; | $y = 10.0; | ||
$result = 0; | $result = 0; | ||
− | $result = | + | $result = Atan2($y, $x) * 180 / @PI; |
printf("The arc tangent for (x=$x, y=$y) is $result degrees.\n"); | printf("The arc tangent for (x=$x, y=$y) is $result degrees.\n"); | ||
// Prints The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees. | // Prints The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees. |
Latest revision as of 16:11, 2 December 2011
ATan2( <expression>, <expression2> )
Contents |
Description
Compute arc tangent with two parameters.
Parameters
expression
Any valid numeric expression.
expression2
Any valid numeric expression.
Return Value
Returns the angle whose tangent is the quotient of two specified numbers.
Remarks
Principal arc tangent of y/x, in the interval [-pi,+pi] radians.
Example
$x = -10.0; $y = 10.0; $result = 0; $result = Atan2($y, $x) * 180 / @PI; printf("The arc tangent for (x=$x, y=$y) is $result degrees.\n"); // Prints The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees.