# Equation of Rotated Ellipse - Semi Major Axis is Changing

I am looking at astronomical observations of gas. The gas is orbiting a black hole with circular radius, $$R$$. However, from Earth it appears that the gas is an inclined ellipse. This is because projection effects cause the circle to be rotated once about its $$y$$ axis, creating an ellipse, before being rotated by an angle $$\theta$$ in the $$z$$ axis (out of the page). Perhaps the below image will help visualise this:

Image showing a circle being first rotated about the $$y$$ axis by an undefined amount, before being rotated about the $$z$$ axis by angle $$\theta$$.

I am looking to fit an ellipse to the $$x,y$$ coordinates I have for the gas on a map of the sky. From the general equation of an inclined ellipse, we have that,

$$\frac{(x \cos(\theta) + y\sin(\theta))^2}{a^2} + \frac{(x \sin(\theta) - y\cos(\theta))^2}{b^2} = 1 ,$$

and from how I have defined the rotation by $$\theta$$, we have that $$b = R$$. I can measure the semi-minor axis, $$a$$, on my map, however the gas emission does not extend out to the semi-major axis. I would like to determine $$R$$, hence I figured that if I rearranged the above for $$b = R$$, then I should find that each $$x,y$$ value would return the same value for $$R$$. Rearranging gives the following, $$\frac{(x\sin(\theta)-y\cos(\theta))^2}{1-(\frac{x\cos(\theta)+y\sin(\theta)}{a})^2} = R^2,$$

at which point I should apologise if any errors have crept in at this point - the main point I'm trying to get across is that, to my reckoning, any $$x,y$$ on the gas ellipse will return the same value for $$R$$ (ignoring errors and physics) when plugged into the above equation. However, when I did do this, my values for $$R^2$$ decreased proportionally to $$x^2 + y^2$$. Again, let's totally ignore the physics here and focus on the mathematics. Can I please check if I have done anything wrong up to this point? Am I correct in stating that $$b = R$$ from the original circle, and that the above equation should hold for all points on the ellipse? What I also found odd, was that if I rearranged the first equation for $$y$$ by getting it in a quadratic form, and plotted $$y$$ vs $$x$$ on Desmos for different values of $$\theta$$, $$a$$ and $$R$$, I did not get an inclined ellipse. I would like to do this so I can plot different ellipses on my data and find the best fitting one. This equation for $$y$$ was pretty ghastly so I will spare you seeing it, but I assume my problem is the same as above, and I have made a mathematical error somewhere in my understanding.

Thank you!

I should add that my coordinate system is centered such that $$x_0, y_0 = 0$$

Rotation matrix $$R_\alpha = \begin{bmatrix}\cos(\alpha)&-\sin(\alpha)\\\sin(\alpha)&\cos(\alpha)\end{bmatrix}$$
Assuming the center of the ellipse is at the origin, rotation by the angle θ for $$ax^2+by^2=1$$ would be: $$a(y sinθ+x cosθ)^2+b(y cosθ-x sinθ)^2=1$$.
To derive the formula, watch the video and solve for $$y=\pm \sqrt {\frac {1-ax^2}{b}}$$