75
Java Math.cos() method
The java.lang.Math.cos() is used to return the trigonometric cosine of an angle. This method returns value between -1 to 1.
Syntax
Parameter
Return
- If the argument is positive or negative number, this method will return the Cosine value.
- If the argument is NaN or infinity, this method will return NaN.
Example 1
Output:
0.5000000000000001
Example 2
Output:
1.0
Example 3
Output:
NaN
Example 4
Output:
0.37127941669980136
Next TopicJava Math