# to find intersection points between line segment and parabola

I have a parabola defined in terms $3$ points i.e $(x_1, y_1), (x_2, y_2), (x_3, y_3)$, consider $(x_1, y_1)$ be start point, $(x_2,y_2)$ be the vertex and $(x_3, y_3)$ be the end point and also provided starting angle and ending angle. Also, I have line segment defined in terms of two points $(m_1, n_1)$ and $(m_2, n_2)$.

I want to get the final equation that provides the intersection points of the line segment and a parabola.

consider this reference image:

• First, find out the equations of the parabola and the line. Then just solve the intersection points. Apr 27 '18 at 7:39
• can i get a pseudo code or a reference link if possible Apr 27 '18 at 7:51
• I don't have a pseudo code, you can calculate the equation of the parabola with one matrix inverse. Assume that the equation is $ax^2 + bx +c = y$, plug in the known values for $x$ and $y$ and you get three equations with three unknowns $a$, $b$, and $c$. Solve with matrix inverse. Apr 27 '18 at 8:02
• And the equation of the line should be easy to do. Apr 27 '18 at 8:02
• @Matti, thanks, ill check it Apr 27 '18 at 8:50

Since it passes through $(x_1,y_1)$, parabola is of form $$f(x)=a(x-x_1)(x-b)+y_1$$ Then plug $(x_2,y_2),(x_3,y_3)$ in order to get values of $a$ and $b$. Then create equation of line using two point from and finally intersect both quations