Intersection of Parametric Equation of a Line with the Standard Equation of an Ellipse

143 Views Asked by At

I am trying to derive an equation that yields the values of λ at the intersection point between a ray and an ellipse. The solution should arrange in a second degree equation.

The equations I am using are $$\vec{l}(λ)=\vec{p}+λ\vec{d}$$ $$\frac{(x-c_x)^2}{a^2}+\frac{(y-c_y)^2}{b^2}=1$$ where $$\vec{p}=[p_x,p_y]$$ is the starting point of the line $$\vec{d}=[d_x,d_y]$$ is the direction of the line $$\vec{c}=[c_x,c_y]$$ is the centre of the ellipse.

Then I rearranged the equation to solve for x and y. $$x=\pm\frac{a\sqrt{b^2-c_y^2+2c_yy-y^2}}{b}+c_x$$ $$y=\pm\frac{b\sqrt{a^2-c_x^2+2c_xx-x^2}}{a}+x_y$$ and substitude the x and y for the x and y equations for the line.

$$p_x+λd_x=\pm\frac{a\sqrt{b^2-c_y^2+2c_yy-y^2}}{b}+c_x$$ $$p_y+λd_y=\pm\frac{b\sqrt{a^2-c_x^2+2c_xx-x^2}}{a}+x_y$$ To get the following two equations find λ: $$λ=\pm\frac{b\sqrt{a^2-c_y^2+2c_yy-y^2}+bc_x-bd_x}{ad_y}$$ $$λ=\pm\frac{a\sqrt{b^2-c_x^2+2c_xx-y^2}+ac_y-ad_y}{bd_x}$$

I am unsure if I am on the right track to solve for λ as I am currently missing values to substitute for x and y inside of the equations. It is also unclear how I am suppose to rearrange the equation to a quadratic form.