首页 > 代码库 > 求两个圆的公切线
求两个圆的公切线
Manipulate[ Block[{deta1, deta2, p1, p2, q, a1, b1, a2, b2, outerLine1, outerLine2, innerLine1, innerLine2}, {{a1, b1}, {a2, b2}} = p; deta1 = (a1 - a2)^2 + (b1 - b2)^2 - (r1 + r2)^2; deta2 = (a1 - a2)^2 + (b1 - b2)^2 - (r1 - r2)^2; p1 = r1 (a2^2 + b2^2 - a1 a2 - b1 b2); p2 = r2 (a1^2 + b1^2 - a1 a2 - b1 b2); q = a1 b2 - a2 b1; innerLine1 = ((a2 - a1) (r1 + r2) + (b1 - b2) Sqrt[ deta1]) x + ((b2 - b1) (r1 + r2) + (a2 - a1) Sqrt[deta1]) y - p1 + p2 + q Sqrt[deta1] == 0; innerLine2 = ((a2 - a1) (r1 + r2) - (b1 - b2) Sqrt[ deta1]) x + ((b2 - b1) (r1 + r2) - (a2 - a1) Sqrt[deta1]) y - p1 + p2 - q Sqrt[deta1] == 0; outerLine1 = ((a2 - a1) (r1 - r2) + (b1 - b2) Sqrt[ deta2]) x + ((b2 - b1) (r1 - r2) + (a2 - a1) Sqrt[deta2]) y - p1 - p2 + q Sqrt[deta2] == 0; outerLine2 = ((a2 - a1) (r1 - r2) - (b1 - b2) Sqrt[ deta2]) x + ((b2 - b1) (r1 - r2) - (a2 - a1) Sqrt[deta2]) y - p1 - p2 - q Sqrt[deta2] == 0; Show[Graphics[{Circle[{a1, b1}, r1], Circle[{a2, b2}, r2]}, PlotRange -> 6, Frame -> 1], ContourPlot[ Evaluate@{outerLine1, outerLine2, innerLine1, innerLine2}, {x, -5,5}, {y, -5, 5}]] ], {{p, {{-3, 1}, {3, 0}}}, Locator}, {{r1, 1}, 1, 3}, {{r2, 2}, 1, 3}]
求两个圆的公切线
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。