I'm working on a simple, two-ring Venn Diagram in JavaScript where the area of the sections will be determined by the set size (mapping dataset count to area in pixels).
Group 1 area (a1) = 800
Group 2 area (a2) = 600
Overlap area (ab) = 100
From this I'm able to get the radiuses with:
$$ r_1 = \sqrt{\frac{a_1}{\pi}} $$
I'm setting the y coordinates of these circles to an arbitrary number (window.innerHeight / 2). However, I'm having trouble determining the distance between the centers of the two circles so that the area of the overlap has an area of ab.
Questions:
Using the three area values (a1, a2, ab), the two radiuses (r1, r2), and a constant y value for the center of the circles, is it possible to determine the distance between the centers of the two circles (d)?
Would I be able to determine the distance between the centers of the circles to the point where the circles intersect? Ideally that would give me a d1 and d2 where d = d1 + d2 so I can use trigonomic functions to get the other values I might need.
What are the forumlas to determine d, d1, and d2?
Here's a visual of the desired product: link to Venn Diagram image
