Java StrictMath.cos(double a)

Syntax

StrictMath.cos(double a) has the following syntax.

public static double cos(double a)

Example

In the following code shows how to use StrictMath.cos(double a) method.


public class Main {
//from   w w w  . j a  va2  s . c o  m
  public static void main(String[] args) {
  
    double d1 = (60*(Math.PI))/180 , d2 = 0.0, d3 = (1.0/0.0) ;
     
    System.out.println("Trigonometric cosine of d1 = " + StrictMath.cos(d1));
     
    System.out.println("Trigonometric cosine of d2 = " + StrictMath.cos(d2));
     
    System.out.println("Trigonometric cosine of d3 = " + StrictMath.cos(d3));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable