Isosceles Triangle :
In[]:=
tri=Triangle[{​​{0,0},{1,0},{0,1}​​}];
In[]:=
Area@tri
Out[]=
1
2
center of ellipse is {xc, yc}, axes are {r1,r2}, orientation is θ.
In[]:=
ell[{xc_,yc_},{r1_,r2_},θ_]=RotationTransform[θ,{xc,yc}]@Ellipsoid[{xc,yc},{r1,r2}];
constraint that ellipse is completely inside triangle
In[]:=
cons[{xc_,yc_},{r1_,r2_},θ_]=RegionWithin[tri,ell[{xc,yc},{r1,r2},θ]];
Assume center of ellipse (xc,yc) is along line x=y so that xc = yc, and call it xyc.
​
Orientation of ellipse is same as diagonal of triangle (Pi/4).
​
Semimajor axis is twice semiminor axis, r, since one diagonal of triangle is twice the other.
Constraint for ellipse to be in triangle, given the assumptions.
In[]:=
cons[{xyc,xyc},{r,2r},Pi/4.]//FullSimplify
Out[]=
r0||(2xyc≤1&&xyc≥0&&
2
xyc
≥2.5
2
r
&&1+4
2
xyc
≥2.
2
r
+4xyc)
Maximize the area of the ellipse inside the triangle, given, the assumptions
In[]:=
sln=FindMaximum[{2*Pi*
2
r
,2xyc≤1&&xyc≥0&&
2
xyc
≥2.5
2
r
&&1+4
2
xyc
≥2
2
r
+4xyc},{r,xyc}]
Out[]=
{0.299995,{r0.218508,xyc0.345491}}
In[]:=
Show[​​RegionPlot[tri],​​RegionPlot[ell[{xyc,xyc},{r,2r},Pi/4]/.sln[[2]]]​​,ImageSize->Small,​​Frame->True]
Out[]=
Ellipse is completely inside triangle.
In[]:=
cons[{xyc,xyc},{r,2r},Pi/4]/.sln[[2]]
Out[]=
True