Facebook Page Twitter Page LinkedIn Page
× C Standard Library


The C <math.h> sin() function is used to return trigonometric sine of an angle (angle should be in radians).

Syntax

double sin (double x);
float sinf (float x);
long double sinl (long double x);

Parameters

x Specify the angle in radian.

Return Value

Returns the trigonometric sine of an angle.

Example:

In the below example, sin() function is used to find out the trigonometric sine of an angle.

#include <stdio.h>
#include <math.h>
 
int main (){
  //M_PI - value of PI from math.h
  printf("%lf\n",sin(M_PI/6));
  printf("%lf\n",sin(M_PI/4));
  printf("%lf\n",sin(M_PI/3));
  return 0;
}

The output of the above code will be:

0.500000
0.707107
0.866025

❮ C <math.h> Library