Math包里
Math.sin(double d);
Math.cos(double d);
//参数是弧度

解决方案 »

  1.   

    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啊。
      

  2.   

    能不能给个具体点的位置,我在StrictMath.java中找到的是 public static native double cos(double a); 而没有具体的实现代码。
      

  3.   

    Math.sin();
    Math.cos();
    ........
      

  4.   

    java提供了一个进行数学方面处理的包,就是java.lang.Math这个包下边有数学函数的
      

  5.   

    哇噻!又是你呀!去C++论坛上看我给你回的帖子,关于sin函数的泰勒展开式。
      

  6.   

    ok, gwsr(咩咩) ----谢谢你给的函数,
    我等一下给分。我原本是想找一个C或者是JAVA中提供给我们的实现。
      

  7.   

    f(x)=f(x0)+ .......f(n)(x0)*x^n/n!