1 public class MathDemo {
 2     public static void main(String[] args) {
 3 
 4         double tan = Math.tan(Math.PI * 45 / 180); // 求角度的tan
 5         double aa = Math.atan(1) * 180 / Math.PI;// 根据tan求角度
 6         double degrees = Math.toDegrees(Math.PI);// 根据弧长求角度
 7         double radians = Math.toRadians(180);// 根据角度求弧长
 8         System.out.println(tan);
 9         System.out.println(aa);
10         System.out.println(degrees);
11         System.out.println(radians);
12     }
13 
14 }

网上查阅了一些资料,对这块没有详细的描述.大家可以根据上面的代码来套用一下. math中角度,弧度的转换应该都是基于半径为1的圆来计算的.

tan()中的参数是这个角度的弧长.并不是角度.需要注意!

相关文章:

  • 2021-09-12
  • 2021-12-11
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-01-10
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2022-01-02
  • 2022-01-22
  • 2021-12-10
  • 2021-07-15
相关资源
相似解决方案