Adjusting the radii of two circles, with known distance between circles

68 Views Asked by At

If I know radius1, and radius2, and the distance between them d, is there a formula that can adjust the radii so that the circles become intersecting if they are not already?

Points are ruled out through these rules:

d > radius1 + radius2
d < |radius1 - radius2|
d = 0
radius1 = radius2

If any of the above rules are met, the circles do not intersect. I need a way to adjust the radii for each case - to make the circles intersect (I am estimating a location)

1

There are 1 best solutions below

0
On

For anyone who knows swift, this explains what I did - its simple addition/subtraction:

if r1 > r2 {
    r1Adjusted = Float(distanceBetween) + r2 - 0.1
}
else if r2 > r1){
    r2Adjusted = Float(distanceBetween) + r1Bigger - 0.1
}

It is quite simple I know, feel free to elaborate.