本帖最后由 qjchen 于 2023-6-27 22:44 编辑
谢谢chenjun兄给出的几何解法,之前一直想不明白这些空间拐来拐去的 :)总是想歪了
太久没有编过lisp了,感觉已经快忘光了,学习chenjun兄的excel及原理编一段,后面的只能靠楼主自己了,请仔细阅读chenjun兄的几何原理及推导。
 - (defun c:test (/ a b c R x xi y yi)
- (setq a 1000 b 3000 c 2000 R 222)
- (setq x 0 y 0)
- (setq xi (fun1 x y b c R))
- (setq yi (fun2 xi y a c R))
- (while (or (> (abs (- xi x)) 1e-12) (> (abs (- yi y)) 1e-12) )
- (setq x xi y yi )
- (setq xi (fun1 x y b c R))
- (setq yi (fun2 xi y a c R))
- )
- (princ "\n xi = ") (princ (rtos xi 2 8));Erase_DV
- (princ "\n yi = ") (princ (rtos yi 2 8));Erase_DV
- (princ)
- )
- (defun fun1 (x y b c R)
- (- b (/ (* R (- (sqrt (+ (* c c) (* x x) (* y y))) x)) (sqrt (+ (* c c) (* y y)))))
- )
- (defun fun2 (x y a c R)
- (- a (/ (* R (- (sqrt (+ (* c c) (* x x) (* y y))) y)) (sqrt (+ (* c c) (* x x)))))
- )
|