acos
double acos ( double x ); | math.h |
cplusplus.com |
Calculate arccosine.
Performs the trigonometric arc cosine operation on x and returns an
angle in the range from 0 to PI expressed in radians.
Parameters.
Return Value.
Arc cosine of x.
Portability.
Defined in ANSI-C.
ANSI-C++ adds float and double overloaded versions of this function,
with the same bahavior but being both, parameter and result, of one of these types.
Example.
/* acos example */
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
main ()
{
double param, result;
param = 0.5;
result = acos (param) * 180 / PI;
printf ("Arccosine of %lf is %lf\n degrees", param, result );
return 0;
}
Output:
Arccosine of 0.500000 is 60.000000 degrees
See also.
asin,
atan,
cos,
sin,
tan