Core Function ATan
From Sputnik Wiki
ATan( <expression>, <expression2> )
Contents |
Description
Calculates the arctangent of a number.
Parameters
expression
Any valid numeric expression.
expression2
Optional; Any valid numeric expression.
If this param is used this ATan will become ATan2
Return Value
WITH ONE PARAM : Returns the trigonometric arctangent of expression.
WITH TWO PARAMS : Returns the angle whose tangent is the quotient of two specified numbers.
Remarks
The result of 4 * ATan(1) is PI.
Example
// Atan with 1 param $x = ATan(0.5); $pi = 4 * ATan(1); $radToDeg = 180 / @PI; $y = ATan(1) * $radToDeg; println( "Value is: $y " ); //arctangent of 1 returns 45° // Atan2 (2 params) $x = -10.0; $y = 10.0; $result = 0; $result = Atan($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.