Monday, February 16, 2026
HomeLanguagesJavaStrictMath toDegrees() Method in Java

StrictMath toDegrees() Method in Java

The java.lang.StrictMath.toDegrees() method of StrictMath class in Java is used to accept an angle measured in radians as a parameter and returns its approximately equivalent angle measured in degrees. So basically it converts radians to degrees. This conversion is generally inexact.

Syntax:

public static double toDegrees(double rad)

Parameters: This function accepts a single parameter rad which refers to an angle in radians which is to be converted to its equivalent degrees.

Return Values:This method returns the measurement of the angle passed as a parameter in degrees.

Examples:

Input : 2.0
Output : 114.59155902616465

Input : 0.007022
Output : 0.4023309637408641

Below programs illustrate the java.lang.StrictMath.toDegrees() method in Java :

Program 1:




// Java Program to illustrate StrictMath.toDegrees()
// function 
  
import java.io.*;
import java.lang.*;
  
class GFG {
    public static void main(String[] args)
    {
  
        double rad = 3.0009871008;
        double deg = StrictMath.toDegrees(rad);
        System.out.println("Value in degrees of " +
                       rad + " radians is " + deg);
    }
}


Output:

Value in degrees of 3.0009871008 radians is 171.943895249041

Program 2:




// Java Program to illustrate StrictMath.toDegrees()
//  function 
  
import java.io.*;
import java.lang.*;
  
class GFG {
    public static void main(String[] args)
    {
  
        double rad = 1.0;
        double deg = StrictMath.toDegrees(rad);
        System.out.println("Value in degrees of " +
                       rad + " radians is " + deg);
    }
}


Output:

Value in degrees of 1.0 radians is 57.29577951308232

Reference: https://docs.oracle.com/javase/8/docs/api/java/lang/StrictMath.html#toDegrees()

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32506 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6882 POSTS0 COMMENTS
Nicole Veronica
12005 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12099 POSTS0 COMMENTS
Shaida Kate Naidoo
7011 POSTS0 COMMENTS
Ted Musemwa
7255 POSTS0 COMMENTS
Thapelo Manthata
6967 POSTS0 COMMENTS
Umr Jansen
6956 POSTS0 COMMENTS