Example usage for java.lang Math PI

List of usage examples for java.lang Math PI

Introduction

In this page you can find the example usage for java.lang Math PI.

Prototype

double PI

To view the source code for java.lang Math PI.

Click Source Link

Document

The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.

Usage

From source file:Main.java

public static void main(String[] argv) {

    System.out.println(Math.PI);

}

From source file:Main.java

public static void main(String[] args) {

    double x = Math.PI / 2;

    x = Math.toRadians(x);/*from   w w  w. jav a 2  s  . c  o m*/

    System.out.println("Math.acos(" + x + ")=" + Math.acos(x));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = (45 * Math.PI) / 180, d2 = 0.0;

    System.out.println("tangent value of d1 : " + StrictMath.tan(d1));

    System.out.println("tangent value of d2 : " + StrictMath.tan(d2));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = (90 * Math.PI) / 180, d2 = 0.0, d3 = (1.0 / 0.0);

    System.out.println("Trigonometric sine of d1 = " + StrictMath.sin(d1));

    System.out.println("Trigonometric sine of d2 = " + StrictMath.sin(d2));

    System.out.println("Trigonometric sine of d3 = " + StrictMath.sin(d3));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = (90 * Math.PI) / 180, d2 = 50, d3 = 0;

    System.out.println("Hyperbolic sine of d1 = " + StrictMath.sinh(d1));

    System.out.println("Hyperbolic sine of d2 = " + StrictMath.sinh(d2));

    System.out.println("Hyperbolic sine of d3 = " + StrictMath.sinh(d3));
}

From source file:Main.java

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));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = (90 * Math.PI) / 180, d2 = 0.0;
    double d3 = (1.0) / (0.0), d4 = -(1.0) / (0.0);

    System.out.println("hyperbolic tangent of d1 = " + StrictMath.tanh(d1));

    System.out.println("hyperbolic tangent of d2 = " + StrictMath.tanh(d2));

    System.out.println("hyperbolic tangent of d3 = " + StrictMath.tanh(d3));

    System.out.println("hyperbolic tangent of d4 = " + StrictMath.tanh(d4));
}

From source file:Main.java

public static void main(String[] args) {

    double d1 = (60 * (Math.PI)) / 180, d2 = 0.0, d3 = (1.0 / 0.0);

    double coshValue = StrictMath.cosh(d1);
    System.out.println("Hyperbolic cosine of d1 = " + coshValue);

    coshValue = StrictMath.cosh(d2);
    System.out.println("Hyperbolic cosine of d2 = " + coshValue);

    coshValue = StrictMath.cosh(d3);
    System.out.println("Hyperbolic cosine of d3 = " + coshValue);
}

From source file:Main.java

public static void main(String[] args) {

    double piVal = Math.PI;

    System.out.format(Locale.US, "%10.2f", piVal);
}

From source file:Main.java

public static void main(String[] args) {

    double piVal = Math.PI;

    System.out.format("%f\n", piVal);

}