Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <math.h> double sin(double x); These functions calculate the trigonometric sine function for the floating-point number x, specifying the angle in radians. |
Return val. Example |
The following program outputs the sine of values in the range -pi to +pi. #include <math.h>
#include <stdio.h>
#define pi 3.14159265358979
int main(void)
{
double x;
for (x = -pi; x <= pi; x = x + pi/4.)
printf(" sin(%1.2f) = %.4f \n ", x, sin(x));
return 0;
}
|
See also | cos, asin, sinh |