Say that an ellipse has its center on the origin and passes through a point $(r,\theta)$ (given in polar coordinates) and is not necessarily parallel to the $x$ and $y$ axes. The equation for such an ellipse may be given by the following:
$$r = \frac{1}{\sqrt{\frac{\cos^2(\theta-k)}{a}+\frac{\sin^2{(\theta-k)}}{b}}}$$
which we can rewrite as
$$\frac{1}{r^2} = \cos^2{\theta}\big(\frac{\cos^2{k}}{a}+\frac{\sin^2k}{b}\big)+\sin^2{\theta}\big(\frac{\sin^2{k}}{a}+\frac{\cos^2k}{b}\big)+\sin{2\theta}\big(\frac{\sin2k}{2b}-\frac{\sin2k}{2a}\big)$$
From here, we can first use the identity $\cos^2{k}=1-\sin^2{k}$ and then distribute and rearrange to get the following.
$$\frac{1}{r^2}-\frac{\cos^2{\theta}}{a}-\frac{\sin^2{\theta}}{b}=\sin^2k\bigg(\cos^2{\theta}\big(\frac{1}{b}-\frac{1}{a}\big)+\sin^2{\theta}\big(\frac{1}{a}-\frac{1}{b}\big)\bigg)+\sin{2k}\big(\frac{\sin{2\theta}}{2b}-\frac{\sin{2\theta}}{2a}\big)$$
Using the squared angle theorem, we then can change this to
$$\frac{1}{r^2}-\frac{\cos^2{\theta}}{a}-\frac{\sin^2{\theta}}{b}=\big(\frac{1-\cos{2k}}{2}\big)\bigg(\cos^2{\theta}\big(\frac{1}{b}-\frac{1}{a}\big)+\sin^2{\theta}\big(\frac{1}{a}-\frac{1}{b}\big)\bigg)+\sin{2k}\big(\frac{\sin{2\theta}}{2b}-\frac{\sin{2\theta}}{2a}\big)$$
Distributing and rearranging yields
$$\frac{1}{r^2}-\frac{\cos^2{\theta}}{a}-\frac{\sin^2{\theta}}{b}-\frac{1}{2}\cos{2\theta}(\frac{1}{b}-\frac{1}{a}) = -\frac{1}{2}\big(\frac{1}{b}-\frac{1}{a}\big)\big(\cos(2k+2\theta)\big)$$
And finally, solving for $k$ gives us
$$k = - \theta - \frac{1}{2}\arccos\bigg(\frac{2\big(\frac{1}{r^2}-\frac{cos^2\theta}{a}-\frac{\sin^2\theta}{b}-\frac{1}{2}\cos{2\theta}(\frac{1}{b}-\frac{1}{a})\big)}{\frac{1}{b}-\frac{1}{a}}\bigg)$$
I did skip past a few interstitial steps here, but I am confident that everything is correct. Is my work sound? I wouldn't find it surprising that the tilt of the ellipse is related to the length of its axes, but I wanted to make sure that I'm on the right path. To reiterate, here we are saying that $r$ and $\theta$ are known quantities, so don't worry about getting lost in a sea of variables. Thank you!