《JAVA编程技巧1001条》第337条:数学函数 SIN。
2017-12-17 10:00
881 查看
第9部分 Java 中的数学函数
337 Using the sin Method
337 sin方法的使用 (译著:以下一段中原文不确切,,已改)
In a triangle, the sine of an angle is the ratio of the angles opposite edge to the hypotenuse. The Math class sin method returns the sine of an angle expressed in radians. The declaration of the sin method is as follows:
在一个直角三角形中,一个角的正弦(sine)就是此角的对边与斜边的比。Math类中的sin方法返回用弧度表示的角的正弦值。方法sin的说明如下:
public static double sin(double a);
To return the sine of an angle, you can use the sin method, as shown:
要得到一个角的正弦,你可按如下所示来使用方法sin:
double num, angle = 0.785398D; // angle in radians, 1/4
num = Math.sin(angle); // return the sine of the angle
In this case, the statements will assign the variable num a value of 0.707107.
在本例子中,语句将把0.707107赋给变量num作为值。
相关文章推荐
- 《JAVA编程技巧1001条》第334条:数学函数 求绝对值.
- 《JAVA编程技巧1001条》第335条:数学函数 SQRT.
- 《JAVA编程技巧1001条》第338条:数学函数 TAN
- 《JAVA编程技巧1001条》第339条:数学函数 ARCCOS
- 《JAVA编程技巧1001条》第341条:数学函数 ARCTAN;
- 《Java编程技巧1001条》第373条: 了解不同的日期标准,
- 《Java编程技巧1001条》第596条: 把WAV格式转成AU格式
- 《Java编程技巧1001条》第600条: 重用update方法来减少图像闪烁
- 《Java编程技巧1001条》357条:用高斯分布建立随机数
- 《Java编程技巧1001条》 第598...条 滚动文本动画
- 《Java编程技巧1001条》第604条:了解图像的观察器
- 在gcc中使用sin等数学函数
- 《Java编程技巧1001条》第591-609条 播放声音剪辑
- 《Java编程技巧1001条》360-373条:用日期函数获得当前日期
- 《Java编程技巧1001条》 第605条: 检测图像装入过程
- 《Java编程技巧1001条》第362条: 用日期类 建立你自己的 日期/时间
- 《Java编程技巧1001条》第375条: 使用DOS下的 TZ 环境变量,
- 《Java编程技巧1001条》第606条: 获得图像的大小尺寸
- JAVA问题总结之7--Pow、sin、sqrt、abs等常用数学函数调用
- 《Java编程技巧1001条》第609条: 建立推进特殊效果