无痕你不是写过吗???
;;输入:PT1 PT2 为节点,b为凸度;输出: r为半径,ctr为圆心 (defun GetRadnCtr (PT1 PT2 b / d a) (setq d (distance PT1 PT2) a (angle PT1 PT2) ) (setq r (abs (/ d (sin (/ (atan (* b 4)) 2)) 2))) (if (>= b 0) (setq ctr (polar (polar PT1 a (/ d 2.0) ) (+ a (/ pi 2)) (sqrt (- (* r r) (* d d 0.25))) ) ) (setq ctr (polar (polar PT1 a (/ d 2.0) ) (- a (/ pi 2)) (sqrt (- (* r r) (* d d 0.25))) ) ) ) ;;(command "_.CIRCLE" ctr r) (princ) )