Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::sin

 

Standard function for calculating the sine of an angle, where the angle is in radians.

 

To use std::sin, the STL header file cmath.h must be #included.

 

#include <cassert>
#include <cmath>

int main ()
{
  const double x = 0.5 * M_PI;
  const double y = std::sin(x);
  assert(y == 1.0);
}


 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict