Skip to content
Related Articles
Open in App
Not now

Related Articles

Java toRadians() method with Example

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 11 Aug, 2021
Improve Article
Save Article

The java.lang.Math.toRadians() is used to convert an angle measured in degrees to an approximately equivalent angle measured in radians. 
Note: The conversion from degrees to radian is generally inexact.


public static double toRadians(double deg)

deg : This parameter is an angle in degrees which
we want to convert in radians.
Return :
This method returns the measurement of the angle 
deg in radians.

Example: To show working of java.lang.Math.toRadians() method. 


// Java program to demonstrate working
// of java.lang.Math.toRadians() method
import java.lang.Math;
class Gfg {
    // driver code
    public static void main(String args[])
        // converting PI from degree to radian
        double deg = 180.0;
        // converting PI/2 from degree to radian
        deg = 90.0;
        // converting PI/4 from degree to radian
        deg = 45.0;


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!