- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
(defun lagr-poly (lpoints)
(lambda (x)
(let ((prod-l nil)
(sum-l nil))
(loop for point in lpoints do
(let ((x0 (x-coord point))
(y0 (y-coord point)))
(loop for pointn in lpoints do
(let ((xn (x-coord pointn)))
(if (not (eq point pointn))
(progn (push (/ (- x xn) (- x0 xn)) prod-l)))))
(push (* (product prod-l) y0) sum-l)
(setq prod-l nil)))
(loop for l in sum-l sum l))))
guest 18.06.2009 10:00 # 0
anonimb84a2f6fd141 25.11.2012 00:17 # −1
anonimb84a2f6fd141 25.11.2012 00:18 # −1