本帖最后由 cabinsummer 于 2011-11-5 20:48 编辑
继续提供思路
求反正切函数
a的反正切d位
- (defun arctan(a d / s n p k)
- (setq s (ReverseNumber a d))
- (setq n 1)
- (setq p s)
- (repeat (1+ (fix (/ (* 6 d (log 10))(log (* a a)))))
- (setq p (divide p a))
- (setq p (divide p a))
- (setq k (divide p (1+ (* 2 n))))
- (if (= (rem n 2) 1)
- (setq s (minuslist s k))
- (setq s (addlist s k))
- )
- (setq n (1+ n))
- )
- s
- )
|