The java.lang.Math.sin() returns the trignometric sine of an angle in between 0.0 and pi. If the argument is NaN or infinity, then the result is NaN. If the argument is zero, then the result is a zero with the same sign as the argument. The value returned will be between -1 and 1.
public static double sin(double a) Parameter : a : the value whose sine is to be returned.
This method returns the sine value of the argument.
Example 1 : To show working of java.lang.Math.sin() method.
0.49999999999999994 0.7071067811865475 0.8660254037844386 1.0
Example 2 : To show working of java.lang.Math.sin() method when argument is NaN or infinity.
NaN NaN NaN
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.