0
$\begingroup$

Here's what I feel is a neat challenge:

I'm building a data visualization comprised of 3 circles of dynamic sizes. I want to have them all intersect at the centre of a bounding box that will also be of no fixed size (it will change).

I will be pulling the radii of the circles from the data, but then can change the x and y coordinates of the circles to make the visualization work.

How would I calculate the positions (x,y) in percentages of the origin of the 3 circles based on their radii and size of the bounding box. Bonus if I can maximize the size of the 3 circles so they take up a decent portion (say ~90%) of the area of the bounding box, for visual purposes.

In the end this will be implemented in JavaScript.

Paul

  • 0
    Can the aspect ratio of the box be chosen at will?2012-02-07
  • 0
    I assumed that it would have to be a square, so we can work with that contraint.2012-02-07

2 Answers 2