Finding all points common to two circles

Posted by Dustin I. on Stack Overflow See other posts from Stack Overflow or by Dustin I.
Published on 2010-04-28T15:37:49Z Indexed on 2010/04/28 15:43 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

In Python, how would one find all points common to two circles?

For example, imagine a Venn diagram-like intersection of two (equally sized) circles, with center-points (x1,y1) and (x2,y2) and radii r1=r2. Additionally, we already know the two points of intersection of the circles are (xi1,yi1) and (xi2,yi2).

How would one generate a list of all points (x,y) contained in both circles in an efficient manner? That is, it would be simple to draw a box containing the intersections and iterate through it, checking if a given point is within both circles, but is there a better way?

© Stack Overflow or respective owner

Related posts about python

Related posts about points