Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if three circles fit inside a triangle

Tags:

math

geometry

I have thought some time about writing a program that tells me if three circles with given diameters can fit inside a triangle with given side lengths without overlapping (touching is ok) each other.

How would one think about doing that?

like image 604
faximan Avatar asked Dec 02 '10 08:12

faximan


People also ask

How many circles fit in a triangle?

Every triangle has three distinct excircles, each tangent to one of the triangle's sides. . Because the internal bisector of an angle is perpendicular to its external bisector, it follows that the center of the incircle together with the three excircle centers form an orthocentric system.

Can a circle fit in a triangle?

The largest circle which fits inside a triangle just touching the three sides of the triangle is called the inscribed circle or incircle. This article is about triangles in which the lengths of the sides and the radii of the inscribed circles are all whole numbers.

How do you find the circle inside a triangle?

Given A, B, and C as the sides of the triangle and A as the area, the formula for the radius of a circle circumscribing a triangle is r = ABC / 4A, and for a circle inscribed in a triangle is r = A / S where S = (A + B + C) / 2.


2 Answers

I would try to find some way to enumerate the possible configurations for the three circles, and then test each configuration until one is found where the three circles fit, or until all configurations have been tested and rejected.

(In what follows I am assuming that each circle is known to fit in the triangle by itself. Obviously if any circle fails to fit by itself then it fails to fit in any configuration of three circles.)

Configuration (1) involves putting a circle in each corner of the triangle. (This is the configuration that everyone spotted.)

a triangle with a big green circle in the top corner, a medium red circle in the bottom right corner, and a small blue circle in the bottom left corner

There are six ways to arrange the circles, and for each arrangement it sufficient to check whether the circles will fit pairwise:

circle with centre O₁ and radius r₁ in the bottom left corner of a triangle (marked A with angle α) and circle with centre O₂ and radius r₂ in the bottom right (marked B with angle β)

The distance AS₁ is r₁/tan(½α), the distance S₂B is r₂/tan(½β), and the distance S₁S₂ is √((r₁ + r₂)² − (r₁ − r₂)²) = 2√r₁r₂

The circles fit if AS₁ + S₁S₂ + S₂B ≤ AB.


In configuration (2) we place two circles into two of the corners of the triangle, and the third circle between these two and one of the two edges that's not touching both circles:

a thin triangle with a big green circle in the top left corner, a medium red circle in the right corner, and a blue circle between them and the top edge

Figuring out whether these will fit is a bit more complex:

the thin triangle marked up: T is where the altitude from centre of the big circle meets the left edge, and S₁ to S₃ are where altitudes from the centres of the three circles meet the bottom edge

To find the length AS₁ we have to walk round the triangle from corner C via the point T. I'll leave the details of this as an exercise.

There are eighteen ways to arrange the circles into this configuration.


Is there a configuration (3)? I looked but couldn't find one that couldn't be turned into one of the two I gave. For example, if all three circles touch the same side then there's always room to swap the middle circle over to the opposite side, getting configuration (2). However, enumeration of geometric configurations is always tricky and I could easily have missed one.

like image 90
Gareth Rees Avatar answered Oct 04 '22 03:10

Gareth Rees


Just a guess: your problem could be related to that of Appolonius's circles.

I ran into it while trying to fit recursively 3 circles within a 4th one without any intersection for some fractal animation, so it may be worth a try.

You'll find it explained in length at Wolfram (this problem was solved only in 1968): http://mathworld.wolfram.com/ApolloniusProblem.html

like image 31
MoonSilex Avatar answered Oct 04 '22 04:10

MoonSilex