Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum surface inside a triangle

I have encountered the following interesting problem while preparing for a contest.

You have a triangle with sides of length a, b, c and a rope of length L. You need to find the surfaced enclosed by the rope that has the maximum surface area and it has to be entirely inside the triangle.

So, if L = a + b + c, then it's the area of the triangle.

Else, we know that the circle has the biggest surface to perimeter area, so if L is smaller or equal to the perimeter of the inscribed circle of the triangle, then the area will be the area of the circle of perimeter L.

So, the remaining case is alfa < L < a + b + c, where alfa is the perimeter of the inscribed circle .

Any ideas would be great!

EDIT: I would like to know if I should focus on some kind of algorithm for solving this or trying to figure it out a mathematical formula. The contest contains somehow a combination of both. The edges can be as long as 100 and the precision of a,b,c,L is of 4 digits after the decimal point .

like image 513
coredump Avatar asked Apr 23 '13 14:04

coredump


4 Answers

After reading the answers to this question: https://math.stackexchange.com/questions/4808/why-circle-encloses-largest-area, I agree with n.m., and think the optimal curve verifies:

  • Curvature is either constant, or flat when it touches the triangle, meaning it is composed of segments lying on the triangle sides, and circle arcs, all sharing the same radius.
  • There are no angles, meaning the arcs are tangent to the triangle sides.

With these conditions, the solution is obtained by three circles of same radius R, each tangent to two sides of the triangle (see below). When R varies between 0 and the radius of the inscribed circle, we start from the triangle itself, and end to the inscribed circle, where all three circles coincide. The length of the curve is the perimeter of the circle of radius R + the perimeter (p) of the smaller triangle: L = 2*PiR + p. The area is the area (a) of the smaller triangle + one disc of radius R + the remaining rectangles: A = PiR^2 + p*R + a.

The described supposed solution

like image 120
Eric Bainville Avatar answered Sep 23 '22 10:09

Eric Bainville


Since a circle has the largest Area/Perimeter, start with the inscribed circle. If L is less than that circumference, then shrink appropriately. If L is longer, grow whichever of the 3 arcs maximizes dA/dL. I don't know if there's a closed form, but the largest arc will be in the 3rd of the triangle with the sides most approaching parallel.

It should be trivial to solve this algorithmically. With 4 decimals of precision, increment by 0.0001 checking each arc to see which has the greatest dA/dL for that single increment.

I worked up a drawing of the geometry overnight: Triangle with incircle The inscribed circle is constructed by bisecting each of the angles and finding the intersections of the bisectors. I've labeled the half-angle "a1" (and all related variables have '1'). The area of the non-circular portion is two trapezoids (one denoted with the red outline). We can calculate the area for a single trapezoid as L1 * (m1 + R)/2 (note that when L1, L2, L3 are all zero, these trapezoids are all zero, and we just get the inscribed circle area). The circular cap has a radius of m1 to remain tangent with the side of the triangle. For a given choice of L1, m1 = R(x1-L1)/x1.

From here you can easily calculate the perimeter and area of each of the three sectors and solve numerically.

I cannot prove that this is the largest area, just that this is how to calculate the area and perimeter of this construction.

like image 42
Mark Ping Avatar answered Sep 23 '22 10:09

Mark Ping


..answering my own comment/question, it can be proved that the radii must be equal,

Here is a useful formula:

enter image description here

the gray area A is

A = r^2 ( alpha - Pi + 2/tan(alpha/2) ) /2

but even more useful..the arc length is simply:

s = 2 ( b - A/r )

from here it is straightforward to show the three radii must be equal to each other:

writing the rope length and enclosed area:

ropelength = trianglelength  - 2  Sum[r[i]  a[i]  ]
ropearea = trianglearea -  Sum[r[i]^2  a[i] /2 ]

where

 a[i]=( alpha[i] - Pi + 2/tan(alpha[i]/2) )

after a bit of manipulation maximizing the area leads to all r[i] equal. Note the three a[i], ropelength,trainglearea,trianglelength are all constants that you do not need to work out. Pedantically solve for r[l] = f( constants, r[2],r[3] ) sub into the second expression and solve for
d ropearea /d r[2] = 0 and d /d r[3] = 0 with the result:

r =(1/2) (triangle_length - rope_length) /(Sum(1/tan(alpha[i]/2)) - Pi)    

(the messy expression for a[i] is substituted only at the last step ) finally..

ropearea = trianglearea - (trianglelength-ropelength)^2/(8 Sum[a[i])
     = trianglearea - (1/2)(trianglelength-ropelength)  r

edit -- a useful identity ..with a,b,c, the lengths of the sides.

Sum(1/tan(alpha[i]/2))  = Sqrt( S^3 / ((S-a)(S-b)(S-c)) )
S = 1/2 (a+b+c)   ! S is semiperimeter not to be confused with arc length s 

the above expressions then can be used to reproduce the formula for an inscribed circle,

 rinscribed = Sqrt( ((S-a)(S-b)(S-c))  / S )
like image 30
agentp Avatar answered Sep 21 '22 10:09

agentp


If the perimeter of the rope is too small or too large, the answers are trivial. The interesting case is a shape with 6 vertices that goes line-arc-line-arc-line-arc. The arc are all tangent to their neighbouring lines and their radii are equal. I don't have a rigorous proof, but imagine a 2D balloon filled with air and squeezed between the sides of the triangle.

It is easy to express the overall shape and thus the perimeter given the radius; the opposite direction (perimeter to radius) is then easily found numerically.

like image 36
n. 1.8e9-where's-my-share m. Avatar answered Sep 19 '22 10:09

n. 1.8e9-where's-my-share m.