Intersecting Circles of Different Radii

Problem #45

Tags: geometry

Who solved this?

Previous:Intersecting Circles of Common Radii Next:3 Points on a Plane


Continuing from the previous problem observing the area intersected by two circles of common radii, now let's allow the two circles to have different radii. Again their centerpoints will be located at (x1, y1) and (x2, y2), such that the two circles intersect, but this time each circle will have radii of r1 and r2 respectively. What is the area of the the intersecting region?

intersection

What is the total area of the purple region bounded by these intersecting circles?

Problem Statement

Input Data
First line will be Q, the quantity of testcases. Q lines will then follow, each holding a testcase in the format r1 x1 y1 r2 x2 y2 describing two intersecting circles with radius r.

Answer
Should consists of Q space=separated values corresponding to the area of the region formed by the intersection of the two circles described in each testcase.
Error should be less than 1e-6.

Example

input data:
2
58 -10 46 65 -58 59
246 85 -72 200 28 37

answer:
5909.360097 99709.352687
You need to login to get test data and submit solution.