<s>[INST] Find the point located on an offset ellipse I am attempting to find either the x & y coordinates of a point located on an offset ellipse. I have the following information to go on:


*

*The angle of a line which intersects the point from the origin

*The radii of the ellipse

*The offset of the ellipse


This image visually demonstrates the problem (The use of symbols do not match up with the workings provided below).
I start with the equation for an offset ellipse:
$${(x - h)^2 \over a^2} + {(y-k)^2 \over b^2} = 1$$
My y-offset $k == 0$, so I get rid of that straight away...
$$\therefore {(x - h)^2 \over a^2} + {(y)^2 \over b^2} = 1$$
I can substitute $y$ for a simple $y = {mx}$ equation, and $m = \tan\theta$ so:
$$\therefore {(x - h)^2 \over a^2} + {(x\tan\theta)^2 \over b^2} = 1$$
Then I proceed to expand and simplify:
$$b^2{(x - h)^2} + a^2{(x\tan\theta)^2} = a^2b^2$$
$${(x - h)^2} + {a^2x^2\tan^2\theta\over b^2} - a^2 = 0$$
$$x^2(1 + {a^2\tan^2\theta\over b^2})-2hx + h^2 - a^2 = 0$$
From here I use
$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
to figure out my possible $x$ values, and $y = x\tan\theta$ to get the matching $y$ values.
Does this seem the correct approach, or can anyone spot where I may be going wrong? I get more-or-less correct values once I code it up in C#, but there seems to be a slight margin of error. I'm not confident in my maths so most of my doubts are here!
Thank you for your help.
Update: An image with matching symbols
 [/INST] The intersections of
$$\frac{(x-h)^2}{a^2}+\frac{(y-k)^2}{b^2}=1$$ and $$y=mx$$
are given by the solutions of
$$b^2(x-h)^2+a^2(mx-k)^2-a^2b^2=0.$$
The coefficients are
$$\begin{cases}A=b^2+a^2m^2,\\B=-2b^2h-2a^2mk,\\C=b^2h^2+a^2k^2-a^2b^2.\end{cases}$$
Then the discriminant
$$\Delta'=a^2b^2(a^2m^2+b^2-(mh-k)^2)$$
and the roots,
$$x=\frac{b^2h+a^2mk\pm\sqrt{\Delta'}}{a^2m^2+b^2},\\y=mx.$$
</s>