Find center and radius of a circle that inscribes three tangent circles

Pierfrancesco

Hi, I have this geometry problem that I’m trying to solve on Grasshopper.
These are the three tangent circles that i’m starting with:

I need to find center and radius of the outer red circle as shown here:

It should be possible to do it using this Descartes theorem:

en.wikipedia.org

Descartes’ theorem

After finding the measure of the radius i’m having some difficulties in finding the center, i have no experience with complex numbers on Grasshopper…

Maybe there’s also a graphical way of finding it

Here’s the gh file of what i’ve done until now:

calcolo sezione media.gh (13.8 KB)

Thanks!


calcolo sezione media_2024Aug9a.gh (18.3 KB)

Hi Joseph, thank you for spending some time in helping me.

Sorry for not being clear enough but I actually need the outer one:

Then why use the word “inscribe” and show the small red circle inscribed in your image?

to draw within a figure so as to touch in as many places as possible
a regular polygon inscribed in a circle


calcolo sezione media_2024Aug10a.gh (32.1 KB)

Playing with your ‘Radius’ sliders, I see this doesn’t always work. :thinking: Later, after coffee.

P.S. There are some conditions where the outer circle appears to be impossible, and other conditions where it is possible but the CircleTTT ‘P’ input (guide point) is wrong. :thinking:


calcolo sezione media_2024Aug10b.gh (32.4 KB)

I went to some extra effort to “dress this up” by showing a red box and hiding the circle when it fails to contain the three circles (actually, I test their center points with InCurve).

calcolo sezione media_2024Aug10c


calcolo sezione media_2024Aug10c.gh (36.3 KB)

P.S. The CircleTTT ‘P’ input (guide point) is derived by scaling the three circle center points by a factor of three and choosing the point that was center of the smallest circle.


calcolo sezione media_2024Aug10cc.gh (40.8 KB)

I couldn’t ask for something better then this! Thank you, I was trying many different ways of doing it since yesterday, sorry again for not being clear enough at the start.

Maybe I’m going to use this tool as part of the research work I’m doing for my master thesis, using it to calculate the aproximate diameter of a structural element made with 3 culms of Arundo Donax or Bamboo. If it will be used, I’m going to let you know in your dms and I will cite you.

One of the terminal conditions I check for is if CircleTTT generates a null value, but that was because I hadn’t yet derived the correct guide point. Since then, it looks like a circle is always generated (?) and the condition that matters is that InCurve counts three center points.

Hello @Pierfrancesco , you are looking for the outer Soddy circle and the Isoperimetric point, which is the center of this circle. Like you, I haven’t fully understood everything mentioned about it on Wikipedia. However, I enjoy exploring how far I can get using ‘Geometry Expressions’, a beautiful but very outdated interactive geometry software, and Wolfram Mathematica. The following Grasshopper document is the result. I have tried to stick to your approach as much as possible, starting with the radii and letting the rest follow. My own approach was to start with the triangle first. Hence the conversion in the lower left of the triangle section, to make it respond as in your Grasshopper program.

In the group of the fourth circle, I used Evaluate components with long formulas to find the center. I derived the formulas using the software mentioned above, based on a geometric construction. I’m not sure if it’s entirely suitable for your purposes, but I really enjoyed making it. It follows a different approach than @Joseph_Oster ’s. As a beginner Grasshopper user, I can fortunately learn a lot from Joseph’s Grasshopper document as well.

There are a few things that still need to be changed: If the outer circle ‘turns inside out,’ the circle should disappear. For finding the outer Soddy center, I’d like to find a more elegant solution, but that’s a hobby for another time. Attached are my solution, starting with the creation of the triangle, and an edit of the file from Pierfrancesco.

calcolo sezione media edit.gh (16.6 KB)
outer_soddy_circle_my_approach.gh (17.5 KB)

edit: It is clear that the center of the outer circle must remain within the triangle to prevent movement of the inner circles when holding the inner three circles in place. If the outer center lies outside the triangle, the diameter of the outer circle is larger than the combined diameters of the two other defining circles, which then no longer have any support.

Here are a few changes and additions to my previous message. I’ve modified the formulas for finding the Outer Soddy Circle Center. I hope it’s become a lot more elegant now. Additionally, the center changes color when it moves on or outside the triangle. The vertices of the triangle change color when the outer circle ‘turns inside out.’ I wanted to post this in case someone in the future is looking for Soddy Circles on this forum. I might later add the Inner Soddy Circle as well (it will take some work and time to find the formulas).

calcolo sezione media edit2.gh (18.9 KB)

1 Like

In Grasshopper, there is a built-in ‘Barycentric Component.’ Until now, I didn’t know how to use it. It turns out you can make a very simple conversion from trilinear coordinates to barycentric coordinates. Now I can use it and have learned something new. This can be applied to all triangle centers. I’ve incorporated this into the Grasshopper algorithm I’ll be posting in this topic. I’ve also added the ‘Inner Soddy Circle’ to the file, which was now very easy. Thanks for the interesting question. Attached is my latest Grasshopper file.

calcolo sezione media final-edit.gh (39.0 KB)

1 Like

Interesting stuff but difficult to follow expressions like these:

(bX^2*aY-bY*aX^2-aY^2*bY+bY^2*aY-cX^2*aY+cX^2*bY+cY*aX^2+aY^2*cY-cY*bX^2-cY*bY^2-cY^2*aY+cY^2*bY+AC^2*bY-AC^2*cY-BC^2*aY+BC^2*cY+(aY-bY)*CC^2)/(2*bX*aY-2*aX*bY-2*cX*aY+2*cX*bY+2*cY*(aX-bX))
(aX^2*bX+aY^2*bX-aX*bX^2-aX*bY^2-aX^2*cX-aY^2*cX+cX*bX^2+bY^2*cX+aX*cX^2-bX*cX^2+aX*cY^2-bX*cY^2-AC^2*bX+AC^2*cX+BC^2*aX-BC^2*cX+(-aX+bX)*CC^2)/(2*bX*aY-2*aX*bY-2*cX*aY+2*cX*bY+2*cY*(aX-bX))

(2*sqrt(t + abs(r + s))*sqrt(-r + abs(r + s))*sqrt(t)*sqrt(r) + aY*(r + s))/(r + s)

r*s*t/(2*((t+s+r)/r/s/t)^(1/2)*r*s*t+(t+s)*r+t*s)
s*r*t/(2*((t+s+r)/s/r/t)^(1/2)*s*r*t+(-t-s)*r-t*s)

The GH code is also complex, in part because it includes “Previous approach” . Redundant code doesn’t help, such as creating the triangle vertices twice and not recognizing the distances between as the same as the length of lines connecting them.

Can you imagine going through life with the last name “Soddy”? :roll_eyes:

Hey, sorry for opening this discussion again, but I have a very similar problem for a different configuration, this time i have to do the same thing for 7 circles. Everyone of them has a different diameter, I’m no expert in geometry, but I think that this time it’s not a possible solution to have every circle tangent to each other:

I found some discussion about circle packing, and it does what i would like to obtain, but it would be great to do it in a way that doesn’t need a physics simulation:

Which things do you want to keep fixed?
If the inner circles cannot move or change their radius, then the outer circle will only be able to be tangent to 3 of them, unless the other circles happen to match the circle determined by these 3.

Hi Daniel. I should start from the diameter of the 7 inner circles, just to be clearer it’s a way of recreating this:

I know that is not possible to obtain an outer circle that is tangent to everyone of them starting from the diameters, but the goal is to get an approximate measure of the diameter of the section.

One option would be to get the outer tangent circle for each set of three of the six outer circles (there will be 6*5*4/6 = 20 of these), exclude any that don’t fully contain all the circles, and pick the smallest remaining one.