Math: toDegrees(double theta) : Math « java.lang « Java by API






Math: toDegrees(double theta)

  
/*
 * Output: 
120.0 degrees is 2.0943951023931953 radians.
1.312 radians is 75.17206272116401 degrees.

 *  
 */

public class MainClass {
  public static void main(String args[]) {
    double theta = 120.0;

    System.out.println(theta + " degrees is " +
                       Math.toRadians(theta) + " radians.");

    theta = 1.312;
    System.out.println(theta + " radians is " +
                       Math.toDegrees(theta) + " degrees.");
  }
}



           
         
    
  








Related examples in the same category

1.Math.E
2.Math.PI
3.Math: abs(int value)
4.Math.cbrt(double a) Returns the cube root of a double value.
5.Math: ceil(float value)
6.Math: copySign(double magnitude, double sign)
7.Math: cos(double doubleValue)
8.Math: exp(double a)
9.Math: floor(float value)
10.Math: getExponent(double d)
11.Math.hypot(double x, double y) Returns sqrt(x2 +y2) without intermediate overflow or underflow.
12.Math: log(double doubleValue)
13.Math.log10(double a)
14.Math: max(int value1, int value2)
15.Math: min(double a, double b)
16.Math: min(int value1, int value2)
17.Math: nextAfter(double start, double direction)
18.Math: nextUp(double d)
19.Math: pow(int a, int b)
20.Math: random()
21.Math.round(double a)
22.Math: scalb(double d, int scaleFactor)
23.Math.signum(float f)
24.Math: sin(double doubleValue)
25.Math.sqrt(int intValue)
26.Math: tan(double doubleValue)
27.Math: toRadians(double theta)