Mathematica Asked on April 24, 2021
Using RegionWithin
it’s quite easy to evaluate a parametric triangle with maximal area inside the disk(constant):
dreieck = Triangle[{{x1, y1}, {x2, y2}, {x3, y3}}] (*parametric triangle*)
sol = NMaximize[{Area[dreieck], RegionWithin[Disk[], dreieck]},Flatten[{{x1, y1}, {x2, y2}, {x3, y3}}]]
Graphics[{FaceForm[Lighter[Gray]], Disk[], FaceForm[Darker[Green]],dreieck /. sol}]
Trying to solve a similar problem triangle with minimal area surrounding the disk makes difficulties
NMinimize[{Area[dreieck], RegionWithin[dreieck, Disk[] ]}, Flatten[{{x1, y1}, {x2, y2}, {x3, y3}}]]
RegionWithin[dreieck, Disk[] ]
can be evaluated separately (huge expression) but NMinimize
starts evaluation without result( EvaluationMonitor shows no progress)
Any idea why Mathematica doesn’t solve? Thanks!
The reason might be that Mathematica fails to find an initial point that satisfies these complex conditions.
a = RegionWithin[dreieck, Disk[]];
FindInstance[a, {x1, y1, x2, y2, x3, y3}, Reals]
Also doesn't terminate. Mathematica doesn't seem to have an option for giving initial points. The more interesting question might be, what can you do solve this problem instead.
You simplify the search for feasible points a lot by choosing different variables. Note that any minimal triangle will touch the circle at 3 points and the lines will be tangents of the circle.
Each point on the unit circle is defined via one real number $b, c, d$ for the sake of rotational symmetry we can assume b == 0
.
$$x cos(b) - y sin(b) + 1 = 0$$ defines a set of $(x,y)$ which is the tangent at the point $(sin(b),cos(b))$.
We can calculate the intersection of two tangents by finding a point $(x,y)$ that satisfies both equations.
Solve[{x Cos[b] - y Sin[b] + 1 == 0, x Cos[c] - y Sin[c] + 1 == 0}, {x, y}]
Has the solution
{x -> -((Sin[b] - Sin[d])/(Cos[c] Sin[b] - Cos[b] Sin[d])),
y -> -((-Cot[b] + Cos[c] Csc[b])/(-Cos[c] + Cot[b] Sin[d]))}
Using those points we can now construct a triangle and calculate the area as you did above. However we also need a constraint that the center of the triangle (average of edge points) must lay in the circle. Futhermore only want to consider triangles bigger than the circle itself.
This results in this query:
NMinimize[{Area[
Triangle[{{-((Sin[b] - Sin[c])/(
Cos[c] Sin[b] - Cos[b] Sin[c])), -((-Cot[c] +
Cos[b] Csc[c])/(-Cos[b] + Cot[c] Sin[b]))}, {-((
Sin[b] - Sin[d])/(
Cos[d] Sin[b] - Cos[b] Sin[d])), -((-Cot[d] +
Cos[b] Csc[d])/(-Cos[b] + Cot[d] Sin[b]))}, {-((
Sin[c] - Sin[d])/(
Cos[d] Sin[c] - Cos[c] Sin[d])), -((-Cot[d] +
Cos[c] Csc[d])/(-Cos[c] + Cot[d] Sin[c]))}}]], ({-((
Sin[b] - Sin[c])/(
Cos[c] Sin[b] - Cos[b] Sin[c])), -((-Cot[c] +
Cos[b] Csc[c])/(-Cos[b] + Cot[c] Sin[b]))} + {-((
Sin[b] - Sin[d])/(
Cos[d] Sin[b] - Cos[b] Sin[d])), -((-Cot[d] +
Cos[b] Csc[d])/(-Cos[b] + Cot[d] Sin[b]))} + {-((
Sin[c] - Sin[d])/(
Cos[d] Sin[c] - Cos[c] Sin[d])), -((-Cot[d] +
Cos[c] Csc[d])/(-Cos[c] + Cot[d] Sin[c]))})/3 [Element]
Disk[], Area[
Triangle[{{-((Sin[b] - Sin[c])/(
Cos[c] Sin[b] - Cos[b] Sin[c])), -((-Cot[c] +
Cos[b] Csc[c])/(-Cos[b] + Cot[c] Sin[b]))}, {-((
Sin[b] - Sin[d])/(
Cos[d] Sin[b] - Cos[b] Sin[d])), -((-Cot[d] +
Cos[b] Csc[d])/(-Cos[b] + Cot[d] Sin[b]))}, {-((
Sin[c] - Sin[d])/(
Cos[d] Sin[c] - Cos[c] Sin[d])), -((-Cot[d] +
Cos[c] Csc[d])/(-Cos[c] + Cot[d] Sin[c]))}}]] >=
Area[Disk[]], b == 0}, {b, c, d}]
which gives us
{5.19615, {b -> 0, c -> 2.0944, d -> -2.0944}}
which when plotted using RegionPlot
looks like:
Wikipedia gives an exact formula for the length of the incircle based on the side length a,b,c. Herons formula gives the area of the triangle using the same information.
s := (a + b + c)/2; Heron = Sqrt[s*(s - a) (s - b) (s - c)];
Minimize[{Heron, 1 == Sqrt[(s - a) (s - b) (s - c)/s], a > 0, b > 0, c > 0}, {a, b, c}]
Minimizes the area of a triangle with a circle of radius 1 inside.
If the resulting expression is Fully Simplified the objective turns out to be 3 Sqrt[3]
(matching our numerical calculation before) while all lengths are 2 Sqrt[2]
Correct answer by worldsmithhelper on April 24, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP