May be I miss what is special here.
Taking
$$\dfrac{x^2}{a^2}+ \dfrac{y^2}{b^2}=1 \tag1$$
with cartesian/polar relations $$ (x,y)=r (\cos \theta, \sin \theta) \tag2 $$
$$\dfrac{1}{r^2}= \dfrac{\cos^2 \theta }{a^2}+ \dfrac{\sin ^2 \theta}{b^2} \tag3 $$
Plug in
$$ \cos \theta = \dfrac{w}{\sqrt{ h^2+w^2}} ,\, \sin \theta = \dfrac{h}{\sqrt{ h^2+w^2}} , r= {\sqrt{ h^2+w^2}}/2 ,\quad a = b \lambda, \tag4 $$
and simplify we get
$$\dfrac{x^2}{{ w^2+h^2 \lambda^2}}+ \dfrac{y^2}{
{ h^2+w^2/ \lambda^2}}=\dfrac14 \tag5$$
"Circumscribing" a rectangle through four points (red) we can have many central conics, not just ellipses. Note that $\lambda^2 $ can have negative values as well for hyperbolas, when semi-minor axis can be even imaginary in general.
