新手求助:已取得点n1,n2,如何求得n3,n3为n1和n2的中点。
如题我现在(setq n1(getpoint "\n请选择第一个点"))
(setq n2(getpoint "\n请选择第二个点"))
取得的两个点n1和n2,现在想求出点n3,n3是n1与n2的中点,要怎么求得n3?
刚开始学习lisp。。。希望得到各位大大的指导
(defun c:tt()
(setq N1 (getpoint "\n请指定第一点:"))
(setq N2 (getpoint "\n请指定第二点:"))
(setq N1X (car N1) N1Y (cadr N1) N2X (car N2) N2Y (cadr N2))
(setq X (/ (+ N1X N2X) 2) Y (/ (+ N1Y N2Y) 2))
(entmake (list (cons 0 "POINT") (list 10 X Y)))
)
页:
[1]