Example usage for java.lang Math toRadians

List of usage examples for java.lang Math toRadians

Introduction

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

Prototype

public static double toRadians(double angdeg) 

Source Link

Document

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Usage

From source file:Main.java

public static void main(String[] args) {

    double x = Math.PI / 2;

    x = Math.toRadians(x);

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

From source file:Main.java

public static void main(String[] args) {

    double x = 45;
    double y = -180;

    // convert them in radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*from w w  w.  j a v a 2 s  .  c o m*/

    System.out.println(x);
    System.out.println(y);

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45;
    double y = -180;

    // convert them to radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*from  www  . ja  va 2 s. com*/

    // print the hyperbolic sine for these doubles
    System.out.println("sinh(" + x + ")=" + Math.sinh(x));
    System.out.println("sinh(" + y + ")=" + Math.sinh(y));

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45;
    double y = -180;

    // convert them in radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*w  w  w. jav a2  s. c om*/

    // print the tangent of these doubles
    System.out.println("Math.tan(" + x + ")=" + Math.tan(x));
    System.out.println("Math.tan(" + y + ")=" + Math.tan(y));

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45;
    double y = -180;

    // convert them to radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*w  w w  .  ja v a  2 s.  c o m*/

    // print the trigonometric sine for these doubles
    System.out.println("Math.sin(" + x + ")=" + Math.sin(x));
    System.out.println("Math.sin(" + y + ")=" + Math.sin(y));

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45;
    double y = -180;

    // convert them in radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*from  www .  ja v  a  2s. c om*/

    // print the hyperbolic tangent of these doubles
    System.out.println("Math.tanh(" + x + ")=" + Math.tanh(x));
    System.out.println("Math.tanh(" + y + ")=" + Math.tanh(y));

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45.0;
    double y = 180.0;

    // convert them to radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);/*from w w w .  ja  v a2 s . c o m*/

    // output their hyperbolic cosine
    System.out.println("Math.cosh(" + x + ")=" + Math.cosh(x));
    System.out.println("Math.cosh(" + y + ")=" + Math.cosh(y));

}

From source file:Main.java

public static void main(String[] args) {

    double x = 45.0;
    double y = 180.0;

    // convert them to radians
    x = Math.toRadians(x);
    y = Math.toRadians(y);// ww w.  j a  va 2s . c om

    // calculate their cosine
    System.out.println("Math.cos(" + x + ")=" + Math.cos(x));
    System.out.println("Math.cos(" + y + ")=" + Math.cos(y));

}

From source file:Main.java

public static void main(String[] args) {

    // get a variable x which is equal to PI/2
    double x = Math.PI / 2;

    // convert x to Radians
    x = Math.toRadians(x);

    // get the arc sine of x
    System.out.println("Math.asin(" + x + ")=" + Math.asin(x));
}

From source file:Main.java

public static void main(String[] args) {

    // get a variable x which is equal to PI/2
    double x = Math.PI / 2;

    // convert x to radians
    x = Math.toRadians(x);

    // get the arc tangent of x
    System.out.println("Math.atan(" + x + ")" + Math.atan(x));
}