#include<cmath>
Trigonometric functions:
It can directly call the corresponding method:
double sin (double);
double cos (double);
double tan (double);
double atan (double);
Note: All values of x radians (radians), i.e. with 180 3.14159 .. FIG.
For example calculated sin (π / 2), then the code is as follows:
int main(void)
{
printf("%f", sin(M_PI/2));
return 0;
}
Corresponding to cos, tan, ctan same usage: COS ( M_PI / 2), Tan (M_PI / 2), CTAN (M_PI / 2)
Extended Information:
c ++ commonly used functions:
1, an inverse trigonometric function
double asin (double); results between [-PI / 2, PI / 2 ]
double acos (double); results between [0, PI]
double atan (double); arctangent (primary value), the results between [-PI / 2, PI / 2]
double atan2 (double, double); arctangent (full circle value), the results between [-PI / 2, the PI / 2]
2, hyperbolic trigonometric
double sinh (double);
double cosh (double);
tanh Double (Double);
. 3, index and number of
double exp (double);
double pow (double, double);
double sqrt (double);
double log (double); logarithm to the base e
double log10 (double);