java tutorial - Java Math.toDegrees() Method - java programming - learn java - java basics - java for beginners



Java numbers to degrees

Learn Java - Java tutorial - Java numbers to degrees - Java examples - Java programs

Description

Method Math.toDegrees() - converts an angle measured in radians into degrees

Syntax

double toDegrees(double d)
click below button to copy the code. By - java tutorial - team

Options

Detailed information about the parameters:

  • d is the double data type.

Return value

  • In Java, Math.toDegrees () converts radians to degrees and returns a double value of type.

Sample Code


            public class Test { 

   public static void main(String args[]) {
      double x = 45.0;
      double y = 30.0;

      System.out.println( Math.toDegrees(x) );
      System.out.println( Math.toDegrees(y) );
   }
}
            
   
click below button to copy the code. By - java tutorial - team

Output

2578.3100780887044
1718.8733853924698 

The formula for converting radians to degrees:

 formula rad to deg

Learn java - java tutorial - java radian to degree- java examples - java programs


Related Searches to Java Math.toDegrees() Method