static double sin(double a) Returns the trigonometric sine of an angle. static double acos(double a) Returns the arc cosine of an angle, in the range of 0.0 through pi. static double asin(double a) Returns the arc sine of an angle, in the range of -pi/2 through pi/2. static double atan(double a) Returns the arc tangent of an angle, in the range of -pi/2 through pi/2. static double atan2(double y, double x) Converts rectangular coordinates (x, y) to polar (r, theta). static double ceil(double a) Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer. static double cos(double a) Returns the trigonometric cosine of an angle. 这些都在JDK里编译好的class里的方法,不想用,要实现,只有自己写啦。 有现成的不用自己去写?老大那干什么还要oo啊。
能不能给个具体点的位置,我在StrictMath.java中找到的是 public static native double cos(double a); 而没有具体的实现代码。
Returns the trigonometric sine of an angle.
static double acos(double a)
Returns the arc cosine of an angle, in the range of 0.0 through pi.
static double asin(double a)
Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
static double atan(double a)
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
static double atan2(double y, double x)
Converts rectangular coordinates (x, y) to polar (r, theta).
static double ceil(double a)
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer.
static double cos(double a)
Returns the trigonometric cosine of an angle.
这些都在JDK里编译好的class里的方法,不想用,要实现,只有自己写啦。
有现成的不用自己去写?老大那干什么还要oo啊。
Math.cos();
........
我等一下给分。我原本是想找一个C或者是JAVA中提供给我们的实现。