<s>[INST] Implicit equation of a sheared ellipse I have the following implicit equation of an ellipse
$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1.$
What will be the equation once it is sheared in the $x$ direction by an angle $\phi$ ?
In other words, suppose I wanted to apply the following shear transformation to the points of an ellipse
$\begin{bmatrix}
x'\\
y'
\end{bmatrix}
=
\begin{bmatrix}
1 & \tan(\phi)\\
0 & 1
\end{bmatrix}
\begin{bmatrix}
x\\
y
\end{bmatrix}$
How would this transformation be represented in an implicit ellipse equation?
 [/INST] \begin{align*}
  x' &= x+y\tan \phi \\
  y' &= y \\
  x  &= x'-y'\tan \phi \\
  \frac{x^2}{a^2}+\frac{y^2}{b^2} &=
  \frac{(x'-y'\tan \phi)^2}{a^2}+\frac{y'^2}{b^2} \\
  \frac{x'^2-2x'y'\tan \phi+y'^2\tan^2 \phi}{a^2}+\frac{y'^2}{b^2} &= 1 \\
\end{align*}

$$b^2x'^2\cos^2 \phi-b^2x'y'\sin 2\phi+(a^2\cos^2 \phi+b^2\sin^2 \phi)y'^2-a^2 b^2 \cos^2 \phi=0$$

</s>