Consider that your rectangle drawn with perspective (using a vanishing point) forms a triangle when the sides are extended to the vanishing point. If you move your rectangle closer to the vanishing point the resulting triangle is similar to the original one. So the "rectangle" after moving it will be similar to the original. The distance from the front edge of the rectangle to the back edge will change as the rectangle moves based on the similar triangle calculation.
So the distance from the vanishing point scales things. Let $\left(x_v,y_v\right)$ be the screen coordinates of the vanishing point. Let your first (blue) rectangle have vertices $A_1,B_1,C_1,D_1$ and the second rectangle have vertices $A_2,B_2,C_2,D_2$ where $A_1$ corresponds to $A_2$ and so on. If you set the screen coordinates of $A_1$ to $\left(x_{a1},y_{ab1}\right)$, $B_1$ to $\left(x_{b1},y_{ab1}\right)$, $C_1$ to $\left(x_{c1},y_{cd1}\right)$, and $D_1$ to $\left(x_{d1},y_{cd1}\right)$ and if you choose the screen coordinates of $A_2$ to be $\left(x_{a2},y_{a2}\right)$ then calculate the screen coordinates of $B_2$ like this:
$x_{b2}=x_v+\left(x_{b1}-x_v\right)\frac{y_{a2}-y_v}{y_{a1}-y_v}$
$y_{b2}=y_{a2}$
The coordinates of $C_2$:
$x_{c2}=x_v+\left(x_{c1}-x_v\right)\frac{y_{a2}-y_v}{y_{a1}-y_v}$
$y_{c2}=y_v+\left(y_{cd1}-y_v\right)\frac{y_{a2}-y_v}{y_{a1}-y_v}$
And the coordinates of $D_2$:
$x_{d2}=x_v+\left(x_{d1}-x_v\right)\frac{y_{a2}-y_v}{y_{a1}-y_v}$
$y_{d2}=y_v+\left(y_{cd1}-y_v\right)\frac{y_{a2}-y_v}{y_{a1}-y_v}$
If you prefer to start with $\left(x,y\right)$ coordinates in the "real" $x$-$y$ plane and project them onto your screen coordinates then the problem is to find 2 functions that take $\left(x,y\right)$ to the screen coordinates $\left(x_s,y_s\right)$. That is a problem in differential equations.
Clearly from the similar triangle analysis:
$\frac{dy_s}{dy}=k_y\left(y_s-y_v\right)$
$y_s=y_v+C_ye^{k_yy}$
and:
$\frac{dx_s}{dx}=k_x\left(y_s-y_v\right)$
$x_s=C_x+k_xC_ye^{k_yy}x$
To make this work you must choose the screen coordinates of the vanishing point $\left(x_v,y_v\right)$ and the screen coordinates of the origin of your "real" $x$-$y$ plane $\left(x_0,y_0\right)$.
When $x=0$:
$x_s=C_x=x_v+\left(x_0-x_v\right)k_xC_ye^{k_yy}$
To make $x_s=x_0$ when $y=0$ we set:
$k_x=\frac{1}{C_y}$
So:
$C_x=x_v+\left(x_0-x_v\right)e^{k_yy}$
When $y=0$:
$y_s=y_0=y_v+C_y$
$C_y=y_0-y_v$
So the final formulas are:
$x_s=x_v+e^{k_yy}\left(x_0+x-x_v\right)$
$y_s=y_v+\left(y_0-y_v\right)e^{k_yy}$
Where $k_y$ is a scale factor that you can adjust to make the coordinates in the "real" $x$-$y$ plane map to the screen coordinates so everything fits on the screen.
Recall that the standard form of an ellipse centered at the origin is $$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1,$$ where $a$ is half the length of the horizontal axis and $b$ half the vertical (so we only need $a, b > 0$ and there is no need to specify $a > b$). Upon counterclockwise rotation by an angle $\theta$ about the origin, that is to say, $$(x,y) \to (x \cos \theta - y \sin \theta, x \sin \theta + y \cos \theta),$$ this equation takes the form $$Ax^2 + Bxy + Cy^2 = 1,$$ where $$\begin{align*}
A &= \frac{\cos^2 \theta}{a^2} + \frac{\sin^2 \theta}{b^2}, \\
B &= \left(\frac{1}{a^2} - \frac{1}{b^2}\right) \sin 2\theta, \\
C &= \frac{\sin^2 \theta}{a^2} + \frac{\cos^2 \theta}{b^2}. \end{align*}$$
Now it should be obvious that the intersection of the red diameter with the ellipse in your second figure is simply the solution to $Ax^2 = 1,$ i.e. $$x = \pm \frac{1}{\sqrt{A}} = \pm \frac{ab}{\sqrt{a^2 \sin^2 \theta + b^2 \cos^2 \theta}}$$ hence the positive value is also half the length of the red diameter.
The blue diameter in the second figure corresponds to the vertical extrema; e.g., what is the largest possible choice of $y$ satisfying $Ax^2 + Bxy + Cy^2 = 1$ for any valid choice of $x$? Some thought should lead you to conclude that this occurs precisely when the quadratic in $x$ $$Ax^2 + (By)x + (Cy^2 - 1) = 0$$ has a repeated root; i.e., the discriminant $$\Delta = (By)^2 - 4A(Cy^2 - 1) = 0.$$ Thus $$y = \pm \frac{2\sqrt{A}}{\sqrt{4AC - B^2}} = \pm \sqrt{a^2 \sin^2 \theta + b^2 \cos^2 \theta}.$$ and the vertical height of the green parallelogram is twice the positive value. The slope of the blue line (after some calculations) should be $$\frac{a^2 \tan \theta + b^2 \cot \theta}{a^2 - b^2},$$ the proof of which is left as an exercise.
I strongly advise you to verify these calculations as I have not spent the time and effort to do so myself.
Best Answer
Start with an ellipse with semi-axes $a\geq b$ in standard position, and intersect it with a $45^\circ$-line $x+y=s>0$, such that the two points of intersection coalesce. This is the case if $s=\sqrt{a^2+b^2}$, and for the point of tangency $(x_*,y_*)$ one obtains $x_*={a^2\over s}$, so that $s-x_*={b^2\over s}$.
In the case at hand the length $s=\sqrt{2}$ is given, and $${A\over B}={s-x_*\over x_*}={b^2\over a^2}\ .$$ We therefore have to solve the system $$a^2+b^2=2,\qquad {b^2\over a^2}={A\over B}$$ for $a$ and $b$. Since $A+B=2$ the result simplifies to $$a=\sqrt{B},\quad b=\sqrt{A}\ .$$