sin - C math.h

C examples for math.h:sin

Type

function

From

<cmath> 
<ctgmath> 
<math.h>

Description

Returns the sine of an angle of x radians.

Prototype

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

Parameters

Parameter Description
x Value representing an angle expressed in radians.

Return Value

Sine of x radians.

Demo Code


#include <stdio.h>
#include <math.h>

#define PI 3.14159265/*  w w  w .jav  a2 s  . co m*/

int main ()
{
  double param = 10.0;
  double result = sin (param*PI/180);
  
  printf ("The sine of %f degrees is %f.\n", param, result );
  
  return 0;
}

Related Tutorials