houlinbo 发表于 2006-8-24 18:43:00

用程序求切点位置

<P>如何确定两圆切点的位置,(圆心位置,半径已知)??????????????</P>
<P>&nbsp; 圆的上下位置可以移动,(外切)</P>

weiliang 发表于 2006-10-17 16:35:00

有图吗?

highflybir 发表于 2006-10-17 17:09:00

houlinbo发表于2006-8-24 18:43:00static/image/common/back.gif回复:(houlinbo)用程序求切点位置
如何确定两圆切点的位置,(圆心位置,半径已知)??????????????
圆的上下位置可以移动,(外切)


<P><BR>请详细说明:</P>
<P>是哪个圆位置确定,哪个圆半径已知,还是都已知,都确定? </P>
<P>能附图说明么? </P>
<P>把题目说清楚了,别人才好给你解答。</P>
<P>另外问一句:这种问题用在什么实际工程中呢? </P>

rongyifei 发表于 2006-11-1 22:31:00

是两个圆的半径和圆心都已知吗?如果是这样的话,这道题并不难解!

rongyifei 发表于 2006-11-1 23:28:00

(defun c:test ()<BR>&nbsp; (princ "请选择两个相切的圆:")<BR>&nbsp; (setq&nbsp;sset (ssget '((0 . "Circle")))<BR>&nbsp; )<BR>&nbsp; (if (&gt; (sslength sset) 2)<BR>&nbsp;&nbsp;&nbsp; (progn<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (alert "选择了两个以上的圆,程序退出")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (exit)<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )<BR>&nbsp; (setq&nbsp;circle1&nbsp;(vlax-ename-&gt;vla-object (ssname sset 0))<BR>&nbsp;circle2&nbsp;(vlax-ename-&gt;vla-object (ssname sset 1))<BR>&nbsp;c_pt1&nbsp;(vlax-safearray-&gt;list<BR>&nbsp;&nbsp;&nbsp; (vlax-variant-value (vla-get-center circle1))<BR>&nbsp;&nbsp;)<BR>&nbsp;c_pt2&nbsp;(vlax-safearray-&gt;list<BR>&nbsp;&nbsp;&nbsp; (vlax-variant-value (vla-get-center circle2))<BR>&nbsp;&nbsp;)<BR>&nbsp;r1&nbsp;(vla-get-radius circle1)<BR>&nbsp;r2&nbsp;(vla-get-radius circle2)<BR>&nbsp;ang&nbsp;(angle c_pt1 c_pt2)<BR>&nbsp;os&nbsp;(getvar "osmode")<BR>&nbsp; )<BR>&nbsp; (setvar "osmode" 0)<BR>&nbsp; (if (equal (distance c_pt1 c_pt2) (+ r1 r2) 0.00001)<BR>&nbsp;&nbsp;&nbsp; (setq tan_pt (polar c_pt1 ang r1))<BR>&nbsp;&nbsp;&nbsp; (if&nbsp;(equal (distance c_pt1 c_pt2) (abs (- r1 r2)) 0.00001)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq tan_pt (polar c_pt1 (+ pi ang) r1))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq tan_pt nil)<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )<BR>&nbsp; (if tan_pt<BR>&nbsp;&nbsp;&nbsp; (progn (command "circle" tan_pt 1)<BR>&nbsp;&nbsp;&nbsp; (alert (strcat "切点坐标为: " (vl-princ-to-string tan_pt)))<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (alert "两圆不相切")<BR>&nbsp; )<BR>&nbsp; (setvar "osmode" os)<BR>)

rongyifei 发表于 2006-11-1 23:32:00

以上是用lisp作的程序,它适用于两个圆的半径和圆心都已知的情况下求切点坐标,关在切点位置画一个小圆!

rongyifei 发表于 2006-11-1 23:36:00

加载上面这段程序,在命令行中输入test,如果不能运行,请在命令行中输入(vl-load-com),再试!

ttt 发表于 2006-11-2 10:14:00

如果知道外切的话,连接两圆圆心,以其中一圆为基点加上半径长,连线角度就可求出交点啊
页: [1]
查看完整版本: 用程序求切点位置