用程序求切点位置
<P>如何确定两圆切点的位置,(圆心位置,半径已知)??????????????</P><P> 圆的上下位置可以移动,(外切)</P> 有图吗? houlinbo发表于2006-8-24 18:43:00static/image/common/back.gif回复:(houlinbo)用程序求切点位置
如何确定两圆切点的位置,(圆心位置,半径已知)??????????????
圆的上下位置可以移动,(外切)
<P><BR>请详细说明:</P>
<P>是哪个圆位置确定,哪个圆半径已知,还是都已知,都确定? </P>
<P>能附图说明么? </P>
<P>把题目说清楚了,别人才好给你解答。</P>
<P>另外问一句:这种问题用在什么实际工程中呢? </P> 是两个圆的半径和圆心都已知吗?如果是这样的话,这道题并不难解! (defun c:test ()<BR> (princ "请选择两个相切的圆:")<BR> (setq sset (ssget '((0 . "Circle")))<BR> )<BR> (if (> (sslength sset) 2)<BR> (progn<BR> (alert "选择了两个以上的圆,程序退出")<BR> (exit)<BR> )<BR> )<BR> (setq circle1 (vlax-ename->vla-object (ssname sset 0))<BR> circle2 (vlax-ename->vla-object (ssname sset 1))<BR> c_pt1 (vlax-safearray->list<BR> (vlax-variant-value (vla-get-center circle1))<BR> )<BR> c_pt2 (vlax-safearray->list<BR> (vlax-variant-value (vla-get-center circle2))<BR> )<BR> r1 (vla-get-radius circle1)<BR> r2 (vla-get-radius circle2)<BR> ang (angle c_pt1 c_pt2)<BR> os (getvar "osmode")<BR> )<BR> (setvar "osmode" 0)<BR> (if (equal (distance c_pt1 c_pt2) (+ r1 r2) 0.00001)<BR> (setq tan_pt (polar c_pt1 ang r1))<BR> (if (equal (distance c_pt1 c_pt2) (abs (- r1 r2)) 0.00001)<BR> (setq tan_pt (polar c_pt1 (+ pi ang) r1))<BR> (setq tan_pt nil)<BR> )<BR> )<BR> (if tan_pt<BR> (progn (command "circle" tan_pt 1)<BR> (alert (strcat "切点坐标为: " (vl-princ-to-string tan_pt)))<BR> )<BR> (alert "两圆不相切")<BR> )<BR> (setvar "osmode" os)<BR>) 以上是用lisp作的程序,它适用于两个圆的半径和圆心都已知的情况下求切点坐标,关在切点位置画一个小圆! 加载上面这段程序,在命令行中输入test,如果不能运行,请在命令行中输入(vl-load-com),再试! 如果知道外切的话,连接两圆圆心,以其中一圆为基点加上半径长,连线角度就可求出交点啊
页:
[1]