toradians qt
数学类静态double toRadians(double angle_in_degrees) (Math Class static double toRadians(double angle_in_degrees) )
This method is available in java.lang package.
此方法在java.lang包中可用。
This method is used to convert the angle from degrees to radians or in other words we can say this method is used to convert an angle measured in degrees to an equivalent angle measured in radians.
此方法用于将角度从度转换为弧度,换句话说,可以说此方法用于将以度为单位的角度转换为以弧度为单位的等效角度。
This is a static method, it is accessible with the class name too.
这是一个静态方法,也可以使用类名进行访问。
The return type of this method is double, it returns the converted angle from degrees to radians of double type.
此方法的返回类型为double ,它将转换后的角度从度转换为double类型的弧度。
In this method, we pass only one parameter which represents an angle in the degrees form.
在此方法中,我们仅传递一个参数,该参数代表度数形式的角度。
This method does not throw any exception.
此方法不会引发任何异常。
The result of conversion an angle from degrees to radians is not generally exact.
将角度从度转换为弧度的结果通常不准确。
Syntax:
句法:
public static double toRadians(double angle_in_degrees){
}
Parameter(s): angle_in_degrees – a ‘double’ type value which is an angel in the degrees.
参数: angle_in_degrees –一个“双精度 ”类型值,以度为单位。
Return value:
返回值:
The return type of this method is double, it returns the converted value from degree to radians.
此方法的返回类型为double ,它将转换后的值从度返回到弧度。
Java程序演示toRadians(double angle_in_degrees)方法的示例 (Java program to demonstrate example of toRadians(double angle_in_degrees) method)
// Java program to demonstrate the example of
// toRadians(double angle_in_degrees) method of Math Class.
public class ToRadiansMethod {
public static void main(String[] args) {
// declaring the variables
double d1 = 60;
double d2 = -60;
double d3 = 90;
double d4 = -90;
// display the values
System.out.println("Angel values in degrees...");
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
System.out.println("d4: " + d4);
// converting the values from degree to radians
d1 = Math.toRadians(d1);
d2 = Math.toRadians(d2);
d3 = Math.toRadians(d3);
d4 = Math.toRadians(d4);
System.out.println("Angel values in radians...");
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
System.out.println("d4: " + d4);
}
}
Output
输出量
E:\Programs>javac ToRadiansMethod.java
E:\Programs>java ToRadiansMethod
Angel values in degrees...
d1: 60.0
d2: -60.0
d3: 90.0
d4: -90.0
Angel values in radians...
d1: 1.0471975511965976
d2: -1.0471975511965976
d3: 1.5707963267948966
d4: -1.5707963267948966
toradians qt