TITLE: Convert a rotated ellipse to sheared ellipse
QUESTION [9 upvotes]: Given an ellipse centred at the origin with major and minor axes and slope of the major axis specified:

How can I convert those three parameters into parameters that would express a scaled and sheared ellipse at the origin?

What I need is the width and height of the green parallelogram and the slope of the blue line when the red line is lying flat.
I might also be interested in versions with angles rather than slopes. I'm assuming it's easier with slopes but I could be wrong.
(I only have maybe highschool level maths so please excuse my ignorance of proper terminology. The images are not mine, just "close enough" ones I found on the net, the angles should actually match. I hope they are clear enough.)

Proposed rewording by @Blue.
A rotated ellipse can be interpreted as a (horizontally-)sheared ellipse. For instance, "an ellipse with radii $a$ and $b$, transformed by rotation through angle $\theta$" is just as well described as "an ellipse with radii $p$ and $q$, transformed by (horizontal) shear of angle $\phi$".

I want to know how to convert from one set of parameters to the other. That is, 

$$\text{Given $a$, $b$, $\theta$, what are $p$, $q$, $\phi$?}$$

It may be easier to express the amount of rotation and shear as slopes rather than angles.
For the shear, I'm more interested the height of the bounding parallelogram ($q$ in the figure) not the transformed radius ($q^\prime$). (Of course, these are related by $q = q^\prime \sin\phi$.)

REPLY [3 votes]: Let the input parameters be $(a, b, \theta)$, which are respectively the length of major and minor axis and the angle of rotation. Of course the first thing is to rotate the ellipse to the "standard" one 
$$\frac{x^2}{a^2} + \frac{y^2}{b^2}=4.$$ 
Let the new ellipse touches the green parallelogram at $(\pm p/2, 0)$ and $\pm (q/2m, q/2)$. Here $p$ is the width (length of the red line), $q$ is the height of the bounding parallelogram and $m$ is the slope of the non-horizontal green line. 
Indeed we need only to find a $2\times 2$ matrix $A$ so that 
$$A\begin{bmatrix} a/2 \\ 0\end{bmatrix} =\begin{bmatrix} p/2 \\ 0\end{bmatrix}, \ \ \ A\begin{bmatrix} 0\\ b/2\end{bmatrix} = \begin{bmatrix} q/2m \\ q/2\end{bmatrix}.$$ 
Then the rectangle bounding the old ellipse will be sent under $A$ to the green parallelogram, and the standard ellipse will be sent to the new one, as suggested in the comment. 
It is easy to see that 
$$A = \begin{bmatrix} p/a & q/bm \\ 0 & q/b\end{bmatrix}.$$
Thus the $ 2\times 2$ matrix
$$\begin{bmatrix} p/a & q/bm \\ 0 & q/b\end{bmatrix} \begin{bmatrix} \cos\theta & \sin\theta \\-\sin\theta & \cos\theta\end{bmatrix}$$
will send the ellipse given by $(a, b, \theta)$ to the ellipse given by $(p,q,m)$.