- (defun acos(a);;;-1<=a<=1
- (angle'(0 0)(list a(sqrt(- 1(* a a)))))
- )
- (defun makeline(p1 p2)
- (entmakex(list'(0 . "line")(cons 10 p1)(cons 11 p2))))
- (defun tt(e1 e2 / a c b r);;圆外公切线
- (setq a(vl-sort(mapcar'(lambda(x)(mapcar'(lambda(y)(cdr(assoc y x)))'(40 10)))
- (mapcar'entget(list e1 e2)))
- (function(lambda(a b)(<(car a)(car b)))))
- r(mapcar'car a)
- c(mapcar'cadr a)
- b(apply'angle c)
- a(acos(/(*(car r)(apply'- r))(*(car r)(apply'distance c)))))
- (mapcar(function(lambda(x)(apply'makeline(mapcar(function(lambda(y z)(polar y(+(* a x)b)z)))c r))))'(1 -1))
- )
很多年前推算外公切线的,没推导内公切线
(defun c:tt( / e1 e2)
(while(and(setq e1(ssget":E:S"'((0 . "CIRCLE"))))
(setq e1(ssname e1 0))
(setq e2(ssget":E:S"'((0 . "CIRCLE"))))
(setq e2(ssname e2 0))
(tt e1 e2))))
) |