<s>[INST] How to solve a rotated ellipse equation for y? Given an x, I want to get the value of y on the Cartesian plane.
It's easy to solve it for a non-rotated ellipse
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \tag{1}$$
$$y = \frac{b}{a} \sqrt{(a^2 - x^2)} \tag{2}$$
How do I solve it when the ellipse is rotated and the equation becomes
$$\frac {(x\cos\theta+y\sin\theta)^2}{a^2}+\frac {(x\sin\theta-y\cos\theta)^2}{b^2}=1\tag{3}$$
No matter what I tried I couldn't get y onto one side. Is there a general equation for this? I'm not able to derive it myself.
Also what happens to (3) when the center is not at the origin? Is it just all the x values become $(x - x_{center})$ and ys become $(y - y_{center})$?
 [/INST] Your third equation can be written as
\begin{eqnarray*}
\color{blue}{y^2} \left( \frac{ \sin^2 \theta}{a^2}+ \frac{ \cos^2 \theta}{b^2} \right) + 2x\color{blue}{y} \sin \theta  \cos \theta \left( \frac{ 1}{a^2}- \frac{ 1}{b^2} \right)+x^2 \left( \frac{ \cos^2 \theta}{a^2}+ \frac{ \sin^2 \theta}{b^2} \right)-1=0.
\end{eqnarray*}
This is a quadratic in $y$ which is easily solved using the well known formula.
</s>