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.
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[]=
r0||(2xyc≤1&&xyc≥0&&≥2.5&&1+4≥2.+4xyc)
2
xyc
2
r
2
xyc
2
r
Maximize the area of the ellipse inside the triangle, given, the assumptions
In[]:=
sln=FindMaximum[{2*Pi*,2xyc≤1&&xyc≥0&&≥2.5&&1+4≥2+4xyc},{r,xyc}]
2
r
2
xyc
2
r
2
xyc
2
r
Out[]=
{0.299995,{r0.218508,xyc0.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