Given the coordinates of several points on a plane, and the radius of a circle surrounding each point, draw polygons representing the circles and the edges where the circles meet. Straight edges will always fall along circle-circle intersection lines, but might not follow the full length of these lines.
Per mbomb007's suggestion, imagine the behavior of 2D soap bubbles. That's technically wrong, because soap bubbles would always meet at 120° angles to minimize energy, while these circles may meet at any angle.
For example, given two points and two radii, the output might look like this:
Add another point and radius and the output might look like this:
You can structure the input however you wish. Please post results with the following inputs.
- x: 10, y: 10, r: 10
- x: 25, y: 12, r: 8
- x: 8, y: 10, r: 6
- x: 20, y: 8, r: 4
- x: 18, y: 20, r: 12
Output should be graphical and should include polygon borders, but nothing else is required. Points and intersections do not need to be represented like they are in the examples.
- No point will exist within the radius of another circle.
- Standard codegolf rules.
- No answers with loopholes will be accepted, but feel free to have fun with it.