本帖最后由 woshiliupingping 于 2010-07-23 23:02:05 编辑

解决方案 »

  1.   

    Math.sin的参数的单位是弧度,不是度
      

  2.   

    看一下  JDK的API  
      

  3.   


     public class wo {
        /**
         * Returns the trigonometric sine of an angle.  Special cases:
         * <ul><li>If the argument is NaN or an infinity, then the 
         * result is NaN.
         * <li>If the argument is zero, then the result is a zero with the
         * same sign as the argument.</ul>
         * 
         * <p>The computed result must be within 1 ulp of the exact result.
         * Results must be semi-monotonic.
         *
         * @param   a   an angle, in radians.
         * @return  the sine of the argument.
         */
    public static void main(String args[]) {
    System.out.println(Math.sin(30*Math.PI/180));
    }
      }    传入的是弧度   那些英文注释是api中队sin方法的描述
      

  4.   

    程序结果没有错
    Math.sin()的参数的单位是弧度,不是角度
    要使用角度还要先转换   角度= 弧度*(Math.PI/180);System.out.println(Math.sin(30*Math.PI/180));
      

  5.   

    Math.sin(double a)的参数a的单位是弧度。