Math类常用方法

三角函数的用法:

public class Demo {
    public static void main(String[] args) {
        System.out.println(Math.sin(60));//正弦函数
        System.out.println(Math.cos(60));//余弦函数
        System.out.println(Math.asin(120));//反正弦函数
        System.out.println(Math.acos(120));//反余弦函数
        System.out.println(Math.tan(60));//正切函数
        System.out.println(Math.atan(120));//反正切函数
        System.out.println(Math.toDegrees(25));//弧度转化为角度
        System.out.println(Math.toRadians(120));//角度转化为弧度
    }
}
运行结果:

Math类常用方法


相关文章:

  • 2021-05-17
  • 2022-02-22
  • 2021-12-04
  • 2021-12-22
  • 2021-09-09
  • 2021-11-27
  • 2021-11-05
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案