Finding a parabola from three points algebraically

$\begingroup$

I'm looking for a method to solve for $A$, $B$, and $C$ in the equation for a parabola given three points $(x_i, y_i), i = 1, 2, 3$. To start, I thought I should try to solve the system of equations:

$$ \left[ \begin{array}{ccc|c} x_1^2 & x_1 & 1 & y_1 \\ x_2^2 & x_2 & 1 & y_2 \\ x_3^2 & x_3 & 1 & y_3 \end{array} \right] $$ As I guessed, this got really messy really quickly, so I just plugged it into Wolfram Alpha and it spit out some of the ugliest things I've seen in a while:

$$ A = \frac{x_3(y_2 - y_1) + x_2(y_1 - y_3) + x_1(y_3 - y_2)}{(x_1 - x_2)(x_1 - x_3)(x_2 - x_3)}\\ B = \frac{x_1^2(y_2 - y_3) + x_3^2(y_1 - y_2) + x_2^2(y_3 - y_1)}{(x_1 - x_2)(x_1 - x_3)(x_2 - x_3)}\\ C = \frac{x_2^2(x_3y_1 - x_1y_3) + x_2(x_1^2y_3 - x_3^2y_1) + x_1x_3(x_3 - x_1)y_2}{(x_1 - x_2)(x_1 - x_3)(x_2 - x_3)} $$

These are horrible! I feel like I'm overcomplicating it. Is there any nicer way of doing it?

$\endgroup$ 1

1 Answer

$\begingroup$

For "nicely picked" numbers $x_1,x_2,x_3,y_1,y_2,y_3$, the equations you listed can be solved to get "nice" solutions for $A,B,C$. However, as you experienced, the general formula can be messy.

Alternatively, you could try using the Lagrange Interpolation Formula:

$P(x) = y_1\dfrac{(x-x_2)(x-x_3)}{(x_1-x_2)(x_1-x_3)} + y_2\dfrac{(x-x_1)(x-x_3)}{(x_2-x_1)(x_2-x_3)} + y_3\dfrac{(x-x_1)(x-x_2)}{(x_3-x_1)(x_3-x_2)}$.

This generalizes nicely to higher order polynomials.

$\endgroup$ 1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like