35. Circle-circle intersection

As is usually the case, you can take several approaches to solving this problem. For example, you could write the equation for one of the circles, solve for x and y, and plug those values into the equation for the second circle. Then, you would solve the new equation for x and y.

Unfortunately, as you saw in the preceding solution, the equation for a circle centered at the point (cx, cy) is fairly complicated, so solving that equation for x and y isn't trivial. When you plug those values into the equation for the other circle, things really get complicated.

Instead of using that method, I'm going to use a geometric approach. Take a look at the circles shown in the following diagram. Our goal is to find the points ...

Get The Modern C# Challenge now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.