C examples for math.h:acos
function
<cmath> <ctgmath> <math.h>
Compute arc cosine of x, expressed in radians.
long double acosl (long double x); long double acos (long double x); double acos (double x); float acosf (float x); float acos (float x); double acos (T x);
Parameter | Description |
---|---|
x | Value whose arc cosine is computed, in the interval [-1,+1]. |
Principal arc cosine of x, in the interval [0,pi] radians.
#include <stdio.h> #include <math.h> #define PI 3.14159265//from w ww . j a v a2 s . c o m int main () { double param = 0.5; double result = acos (param) * 180.0 / PI; printf ("The arc cosine of %f is %f degrees.\n", param, result); return 0; }