C/Math/Cos ACos
Содержание
Calculate arccosine: acos
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double v, result;
v = 0.5;
result = acos ( v ) * 180 / PI;
printf ("Arccosine of %lf is %lf\n degrees", v, result );
return 0;
}
Calculate cosine: how to use cos
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double p, result;
p = 45;
result = cos ( p * PI / 180);
printf ("Cosine of %lf degrees is %lf\n", p, result );
return 0;
}
Calculate hyperbolic cosine:how to use cosh
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double p, result;
p = 45;
result = cosh ( p * PI / 180);
printf ("Hyperbolic cosine of %lf degrees = %lf\n", p, result );
return 0;
}
How to use acos
#include <math.h>
#include <stdio.h>
int main(void)
{
double val = -1.0;
do {
printf("Arc cosine of %f is %f.\n", val, acos(val));
val += 0.1;
} while(val<=1.0);
return 0;
}
How to use cos
#include <math.h>
#include <stdio.h>
int main(void)
{
double val = -1.0;
do {
printf("Cosine of %f is %f.\n", val, cos(val));
val += 0.1;
} while(val<=1.0);
return 0;
}
How to use cosh
#include <math.h>
#include <stdio.h>
int main(void)
{
double val = -1.0;
do {
printf("Hyperbolic cosine of %f is %f.\n", val, cosh(val));
val += 0.1;
} while(val<=1.0);
return 0;
}