2.12. Calculating Trigonometric Functions
2.12.3. Discussion
These functions assume their arguments are in
radians, not
degrees. (See Recipe 2.13 if this is a
problem.)
The function atan2( ) takes two variables $x and
$y, and computes atan($x/$y).
However, it always returns the correct sign because it uses both
parameters when finding the quadrant of the result.
For
secant, cosecant,
and cotangent, you should manually calculate the reciprocal values of
sin( ), cos( ), and
tan( ):
$n = .707;
$secant = 1 / sin($n);
$cosecant = 1 / cos($n);
$cotangent = 1 / tan($n);
Starting in PHP 4.1, you can also use
hyperbolic
functions: sinh( ), cosh( ),
and tanh( ), plus, of course, asin(
), cosh( ), and atanh(
). The inverse functions, however, aren't
supported on Windows.
   2.11. Printing Correct Plurals   2.13. Doing Trigonometry in Degrees, not Radians 
Copyright © 2003 O'Reilly & Associates. All rights reserved.

