;;反正弦函数(asin 值)
(defun asin(x)
(cond
((or (> x 1) (< x -1)) nil)
((= x 1) (* pi 0.5))
((= x -1) (* pi -0.5))
(t (atan (/ x (sqrt (- 1 (* x x))))))
)
)
;;反余弦函数(acos 值)
(defun acos(x)
(if (>= x 0)
(asin (sqrt (- 1 (* x x))))
(+ pi (- (asin (sqrt (- 1 (* x x))))))
)
)
(defun asin(x)
(cond
((or (> x 1) (< x -1)) nil)
((= x 1) (* pi 0.5))
((= x -1) (* pi -0.5))
(t (atan (/ x (sqrt (- 1 (* x x))))))
)
)
;;反余弦函数(acos 值)
(defun acos(x)
(if (>= x 0)
(asin (sqrt (- 1 (* x x))))
(+ pi (- (asin (sqrt (- 1 (* x x))))))
)
)
