.sin()
Published Dec 17, 2022
Contribute to Docs
The Math.sin()
method returns the trigonometric sine of an angle argument, given in radians.
Syntax
Math.sin(angle)
The angle
parameter is expressed in radians.
- The result is in the range [-1, 1].
- If the
angle
isNaN
or infinity,NaN
is returned.
Example
The following example demonstrates the application of .sin()
method:
// Check.javapublic class Check {public static void main(String args[]) {// convert degrees to radiansdouble pi = Math.PI;double degree = 60;double radian = degree * pi/180;System.out.println( "Sine of 60 degrees is " + Math.sin(radian));}}
This results in the following output:
Sine of 60 degrees is 0.866025
Contribute to Docs
- 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.