- (defun arcsin(r / result )
- (if (and (/= 1 (abs r))(/= 1.0 (abs r)))
- (setq result (atan (/ r (sqrt (- 1 (* r r))))))
- (cond ((< r 0) (setq result (/ pi -2.0)))
- ((> r 0) (setq result (/ pi 2.0)))
- )
- )
- result
- )
- (defun arccos(r / result)
- (if (and (/= r 0)(/= r 0.0))
- (setq result (atan (/ (sqrt (- 1 (* r r))) r)))
- (setq result (/ pi 2))
- )
- (if (< result 0)
- (setq result (+ pi result))
- )
- (if (or (= r -1)(= r -1.0))(setq result pi))
- result
- )
|