无涯教程-Java - toDegrees()函数

110 阅读1分钟

该方法将参数值转换为度。

toDegrees() - 语法

double toDegrees(double d)

这是参数的详细信息-

  • d  -  double双精度数据类型。

toDegrees() - 返回值

  • 此方法返回一个双精度值。

toDegrees() - 示例

public class Test { 

   public static void main(String args[]) {
      double x=45.0;
      double y=30.0;

      System.out.println( Math.toDegrees(x) );
      System.out.println( Math.toDegrees(y) );
   }
}

这将产生以下输出-

2578.3100780887044
1718.8733853924698

参考链接

www.learnfk.com/java/number…