sin
double  sin ( double x );
math.h
  cplusplus.com  

Calculate sine.
  Performs the trigonometric sine operation on x returning a value between -1 and 1.

Parameters.

x
Angle expressed in radians (180 degrees = PI radians).

Return Value.
  Sine of x.

Portability.
  Defined in ANSI-C.
  ANSI-C++ adds float and double overloaded versions of this function, with the same bahavior but being both, parameter and result, of one of these types.

Example.

/* sin example */
#include <stdio.h>
#include <math.h>

#define PI 3.14159265

main ()
{
  double param, result;
  param = 45;
  result = sin (param*PI/180);
  printf ("Sine of %lf degrees is %lf\n", param, result );
  return 0;
}
Output:
Sine of 45.000000 degrees is 0.707107

See also.
  acos, asin, atan, cos, tan


© The C++ Resources Network, 2000