转自:
Java Math.tan()/Math.tanh()具有什么功能呢?
下文讲述Math.tan()/Math.tanh()的功能简介说明,如下所示:
Math.tan()的功能:用于计算正切
Math.tanh()的功能:用于计算双曲正切
-------语法说明-----
public static double tan(double a)
public static double atan(double a2)
参数说明
a //以弧度表示的角度
a2 //弧切线的值
返回值
弧正切
例
public class TestClass {
public static void main(String[] args) {
//使用角度获取其tan
double t = Math.tan(Math.PI * 45 / 180);
//使用tan求角度
double a = Math.atan(1) * 180 / Math.PI;
System.out.println(t);
System.out.println(a);
}
}
-----运行以上代码,将输出以下信息----
0.9999999999999999
45.0