- 注册时间
- 2010-4-21
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 7298
- 在线时间
- 小时
|
楼主 |
发表于 2014-8-28 16:33:28
|
显示全部楼层
搜到一个不错的链接https://donghaoren.org/blog/2009/circle-common-tangents(不过文章中的公式某个符号好像写错了),可以用Mathematica验证:
- Manipulate[
- Block[{deta, p1, p2, q, a1, b1, a2, b2, line1, line2},
- {{a1, b1}, {a2, b2}} = p;
- deta = (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;
- line1 = ((a2 - a1) (r1 - r2)+(b1 - b2) Sqrt[deta]) x + ((b2 - b1) (r1 - r2) + (a2 - a1) Sqrt[deta]) y - p1 - p2 + q Sqrt[deta]==0;
- line2 = ((a2 - a1) (r1 - r2)-(b1 - b2) Sqrt[deta]) x + ((b2 - b1) (r1 - r2) - (a2 - a1) Sqrt[deta]) y - p1 - p2 - q Sqrt[deta]==0;
- Show[Graphics[{Circle[{a1, b1}, r1], Circle[{a2, b2}, r2]},
- PlotRange -> 6, Frame -> 1],
- ContourPlot[Evaluate@{line1, line2}, {x, -9, 9}, {y, -9, 9}]]
- ], {{p, {{-3, 1}, {3, 0}}}, Locator}, {{r1, 1}, 1, 3}, {{r2, 2}, 1,
- 3}]
复制代码
已更新,内外公切线都有了
- 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}]
复制代码
|
|