Java toRadians() method with Example Last Updated : 11 Aug, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Syntax: public static double toRadians(double deg) Parameter: 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 // 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; System.out.println(Math.toRadians(deg)); // converting PI/2 from degree to radian deg = 90.0; System.out.println(Math.toRadians(deg)); // converting PI/4 from degree to radian deg = 45.0; System.out.println(Math.toRadians(deg)); } } Output: 3.141592653589793 1.5707963267948966 0.7853981633974483 Comment More infoAdvertise with us Next Article Java Math tan() method with Examples B barykrg Follow Improve Article Tags : Misc Java Java-lang package java-math Practice Tags : JavaMisc Similar Reads Java toDegrees() method with Example The toDegrees() method comes under the java.lang.Math package. This method is used to convert an angle from radians to its equivalent degrees. This method is useful in mathematical computations where angle conversion is required, for example, trigonometry, geometry etc.Note: The conversion from radi 2 min read Java Math tan() method with Examples The Math.tan() method of java.lang.Math class calculates the trigonometric tangent of an angle. Suppose there is a right-angled triangle, so tan(angle) is the opposite side divided by the adjacent side. If the argument is NaN or an infinity, then the result returned is NaN.If the argument is zero, t 2 min read Java signum() method with Examples The Math.signum() method is a part of the java.lang.Math package. This method returns the sign function of a value passed to it as an argument. In this article, we are going to discuss how this method works for regular values and for special cases such as infinity and NaN.Special Cases:If the argume 2 min read Java Math sin() method with Examples The java.lang.Math.sin() returns the trigonometry sine of an angle in between 0.0 and pi. If the argument is NaN or infinity, then the result is NaN. If the argument is zero, then the result is a zero with the same sign as the argument. The value returned will be between -1 and 1. Syntax : public st 2 min read Period of() method in Java with Examples The of() method of Period Class is used to obtain a period from given number of Years, Months, and Days as parameters. These parameters are accepted in the form of integers. This method returns a Period with the given number of years, months, and days. Syntax: public static Period of( int numberOfYe 2 min read Period plus() method in Java with Examples The plus() method of Period class in Java is used to add the given amount of period to the specified period. This functions operates separately on YEAR, MONTH and DAY. Note: Normalization is not performed. 12 months and 1 year are different. Syntax: public Period plus(TemporalAmount amountToAdd) Par 2 min read Like