Groovy - radian()



The method converts the argument value to radians.

Syntax

double toRadians(double d)

Parameters

d - A double data type.

Return Value

This method returns a double value.

Example

Following is an example of the usage of this method −

class Example {
   static void main(String[] args) {
      double x = 45.0;
      double y = 30.0;  
		
      System.out.println( Math.toRadians(x) );
      System.out.println( Math.toRadians(y) );
   } 
}

When we run the above program, we will get the following result −

0.7853981633974483 
0.5235987755982988 
groovy_numbers.htm
Advertisements