We are trying to solve for the constants a,b,c so that the polynomial a+bx+cx^2 gives the appropriate points. Suppose those points are (x1,y1), (x2, y2), (x3,y3).

The typical way to solve this is by using some linear algebra (I know! linear algebra lets you solve quadratics? It's somewhat surprising but we actually know x here and so we don't need to worry about any quadratic behavior. The things were solving for are a, b, and c which are only used linearly in this equation.). If you aren't familiar with this then you'll have to solve it out entirely (and may want to either way if you're not already using a linear algebra library). What this means is that we can plug each point (x,y) into the polynomial and this gives us a constraint on the possible values of a,b,c. So we get:

a + b*x1 + c*x1^2 = y1

a + b*x2 + c*x2^2 = y2

a + b*x3 + c*x3^2 = y3

These are three equations and we have three unknowns a,b,c so it should be solvable, at least so long as the three points permit a unique solution (almost all such points do). You can now solve these three equations for a,b,c.

If you know linear algebra, then this is just solving the matrix-vector equation:

The matrix M =

| 1 x1 x1^2 |

| 2 x2 x2^2 |

| 3 x3 x3^2 |

The vector Y = {y1, y2, y3} (a column vector)

The vector X = {a,b,c} (also a column vector).

Solve M * X = Y, or X = M \ Y if you're in a language or package that support matrix math directly. Most such languages will also have built-in functions to do this sort of thing. Look for polynomial fitting or least squares (though least squares would technically be overkill).

Or, like I said, you can solve this any other way that you want, such as substitution that most people learn by

highschool algebra.

Edit:

Actually, I feel like doing that substitution out right now. Starting with the last equation:

Quadratic Bezier curves are very simple to do with 3 points. The equation of the curve would be \( C(t) = P_0(1-t)^2 + 2P_1t(1-t)+P_2t^2 \) and you vary t from 0 to 1 to get the whole curve. You can design the curve to pass through your middle point, so you'll have to find the second control point. You can use the Hermite spline formulation to get that second control point.