Rational Quadratic Bezier Curve

Click and drag control points to change curve. Modify weights in boxes below the curve.

For more information, check out the post on my blog: Bezier Curves.
Your browser doesn't seem to support the necesary html5 features ):
W1
W2
W3

Note that rational quadratic bezier curves can represent conic sections exactly, whereas a regular (integral) bezier curve cannot. To match the arc of a circle, the weighting for W2 should be cos(arcAnge/2). In the example above, it defaults to matching 90 degrees of a circle. Try setting W2 to 1 to see how a regular bezier curve handles the same control points, or try negating the sign of the default to see it take the long path around the circle!

Rational quadratic bezier curves have 3 control points, a weight per control point (3 total), and total up the values of the 3 functions below to get the final point at time t.
  1. A * W1 * (1-t)^2
  2. B * W2 * 2t(1-t)
  3. C * W3 * t^2
Then they divide by the total of these 3 functions.
  1. W1 * (1-t)^2
  2. W2 * 2t(1-t)
  3. W3 * t^2
Parameters:
t - "Time", this value goes from 0 to 1 to generate each point on the curve
A - The first control point, also the starting point of the curve.
B - The second control point.
C - The third control point, also the ending point of the curve.
W1 - The weighting for control point A.
W2 - The weighting for control point B.
W3 - The weighting for control point C.

In other words, if you have 3 control points A,B and C, 3 weights W1, W2, W3 and a time t:
CurvePoint = (A*W1*(1-t)^2 + B*W2*2t(1-t) + C*W3*t^2) / (W1*(1-t)^2 + W2*2t(1-t) + W3*t^2).

Note that this bezier curve is 2 dimensional because A,B,C are 2 dimensional, but you could use these same equations in any dimenion!