sin()
yash.ladekar7 total contributions
Published Oct 8, 2022Updated Jun 20, 2023
Contribute to Docs
The sin()
function returns the sine of an angle argument, given in radians, in the range [-1,1].
Syntax
sin(angle)
The angle
parameter is expressed in radians.
Example
The following example illustrates the sin()
function:
#include<iostream>#include<math.h>using namespace std;int main() {// convert degrees to radiansdouble pi = M_PI;double degree = 60;double radian = degree * pi/180;cout << "Sine of 60 degrees is " << sin(radian) << "\n";return 0;}
This results in the following output:
Sine of 60 degrees is 0.866025
Codebyte Example
The following code example returns the sine of a angle given in radians using the sin()
function.
All contributors
- yash.ladekar7 total contributions
- Christine_Yang271 total contributions
- garanews222 total contributions
- Yash-Var4 total contributions
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.