Function name : sin
Header file : <math.h>
Function prototype : double sin(double x);
Function : sine function
Parameters : double x The radian of the operation
Return value : Returns the sine value of radians
Formula: 1°=π/180°radians
Program example : Find the sine of an angle of 30 degrees and output the result
#include<stdio.h>#include<math.h>#definePI3.14159265intmain(void){doubleresult,x=30*PI/180;//Convert a 30-degree angle into radians result=sin(x);printf( Thesin()of%lfis%lfn,x,result);return0;}
Running results:
Thesin()of0.523599is0.500000