ivaneeo's blog

自由的力量,自由的生活。

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
The sine of an angle (specified in radians) can be computed by making use of the approximation sinxbook-Z-G-D-20.gifx if x is sufficiently small, and the trigonometric identity
    ch1-Z-G-19.gif

to reduce the size of the argument of sin. (For purposes of this exercise an angle is considered ``sufficiently small'' if its magnitude is not greater than 0.1 radians.) These ideas are incorporated in the following procedures:
    (define (cube x) (* x x x))
    (define (p x) (- (* 3 x) (* 4 (cube x))))
    (define (sine angle)
       (if (not (> (abs angle) 0.1))
           angle
           (p (sine (/ angle 3.0)))))

posted on 2006-07-31 15:02 ivaneeo 阅读(572) 评论(0)  编辑  收藏 所属分类: scheme-语言之母

只有注册用户登录后才能发表评论。


网站导航: