在java三角函数怎么用
收起
云计算小粉
2018-05-10 20:09:15
2451
0
2
条回答
写回答
取消
提交回答
-
Math.sin
2019-07-17 22:18:32
-
都在下面啦,自己挑挑看
public void test(){
System.out.println("ExampleUnitTest-Sin 90°="+Math.sin(Math.PI/2));
System.out.println("ExampleUnitTest-30°-1="+Math.toDegrees(Math.PI/6));
System.out.println("ExampleUnitTest-30°-2="+Math.toDegrees(Math.asin(Math.sin(Math.PI/6))));
System.out.println("ExampleUnitTest-sin30°="+Math.sin(Math.PI/6));
System.out.println("ExampleUnitTest-asin 0.5="+Math.toDegrees(Math.asin(0.5)));//求一个正弦值的弧度对应角度
System.out.println("ExampleUnitTest-cos 60°=="+Math.cos(Math.PI/3));
System.out.println("ExampleUnitTest-tan 45°=="+Math.tan(Math.PI/4));
System.out.println("ExampleUnitTest-atan=="+Math.atan(Math.tan(Math.PI/4)));//求孤独
System.out.println("ExampleUnitTest-atan1=="+Math.atan(1));//求斜率对应的孤独
System.out.println("ExampleUnitTest-atan1=="+Math.toDegrees(Math.atan(1)));//求斜率对应的孤独的对应角度
}
2019-07-17 22:18:32