圆圈交汇点 [英] Circle-circle intersection points

查看:159
本文介绍了圆圈交汇点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何计算交会的两个圆点。我希望那里是任意两个,一个或者没有交点在所有情况下。

How do I calculate the intersection points of two circles. I would expect there to be either two, one or no intersection points in all cases.

予有x和中心点的y坐标,和半径为每个圆

I have the x and y coordinates of the centre-point, and the radius for each circle.

在Python的答案会是preferred,但任何工作的算法是可以接受的。

An answer in python would be preferred, but any working algorithm would be acceptable.

推荐答案

您还可能会发现C code。在我的书的计算几何在C中,第8章。 在code( arm.c )可在该链接(也Java中)。但它看起来像你现在有几个code来源。

You may also find C code in my book Computational Geometry in C, Chapter 8. The code (arm.c) is available at that link (also in Java). But it looks like you have several code sources by now.

请注意,有可能为两个圆,以零个,一个,两个,或无限点数相交。据我所看到的,贴code不处理所有的可能性, 但特殊情况下,都不难发现。

Note that it is possible for two circles to intersect in zero, one, two, or an infinite number of points. As far as I can see, the posted code does not handle all possibilities, but the special cases are not difficult to detect.

这篇关于圆圈交汇点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆