State Fair
This problem gives you a circle and the length of the "unique" edge of an isosceles triangle and asks you for the shortest the other legs must be such that the triangle encloses the circle.
Note first that this question is ill-specified. It refers to the "shorter" side and longer "sides," but there is no guarantee in an isosceles triangle that the shorter side is the unique side. It doesn't state what to do in such a situation, as one could:
- actually optimize for minimal rope, and make the similar sides "shorter" than the unique side
- make the "shorter" side one of the similar sides, meaning there is only one longer "side"
- "stretch" the other two sides so that the unique side is still shorter, but this does not minimize rope.
It is impossible to satisfy all the constraints of the problem as written in all cases. Given that the output is a single number, we will assume that we can choose option 1.
Solution 1
Intuitively, we can see that the edges will all be tangent to the circle to get minimum distance. This means we just have to do some trig. Consider the triangle formed by the midpoint of the given edge (tangent to the circle...due to isoscelesness...remember tangent lines form right angles to the radius!), the center of the circle, and one of the angles of the triangle we are forming. We can use the pythagorean theorem to solve the length of the edge from the center of the circle to that angle.
Now consider the tangent point of one of the "longer" sides. We can solve the distance from the angle from above to this point using pyth plus an edge drawn from the center to THIS tangent point.
Lets call the edge length we're trying to solve for x, and the segment we just solved for as a, and the distance from the midpoint of the circle to the angle of the two similar sides as y. We can then form two similar triangles:
- c/2, r + y, x
- r, x-a, y
We know c/2 and r, so we know the ratio of the other similar sides will follow. This gives us two equations (one for each of the two sides) with two unknowns (x and y), which we can solve for.
Solution 2
Since each edge is tangent to the cirlce, this means the circle is inscribed. Note that the center of the inscribed circle will be the intersection of the angle bisectors. If we take the angles formed by the "short" edge and the longer ones, and bisect it, this bisected angle will be arctan(r/(c/2)). Double this will be one of the angles of our final triangle. We can solve for the third unique angle and then apply the law of sines to get the third edge. Alternatively, once we have the single angle, we know cos(θ)=(c/2)/x, solve for x.