(Solved) Circumscribe all circles in field of circles

37 Views Asked by At

I'm making a program that consists of a bunch of placable/moveable items in space, and each item has an invisible circle encompassing its size. The items can be parented to other items, so for each parent item I also want the smallest possible outer circle that encompasses the extent of all its children. For example, if I had a parent item at (0,0) with size 1, and a child at (4, 0) also size 1, the outermost points would be (-1, 0) and (5, 0) therefore the outer circle would be at (2, 0) with radius 6.

My question is: what's the most efficient way for the program get this circle if it has several arbitrarily placed/sized circles to look at, most of which are probably irrelevant? So essentially how do I get the 2 or 3 outermost points and circumscribe them?

Also, this project is actually in a 3D world so really it would all be spheres... I just figure it'd be easier to start with circles and add a dimension once I understand the simpler version