The Bézier Curve is a type of
spline curve with two
end points and two
control points.
Best used to calculate the position of an object traveling along such a curve at a particular time (t).
{note:
point0 = end point 1
point1 = control point 1
point2 = control point 2
point3 = end point 2
}
x(t) = Axt3 + Bxt2 + Cxt + x0
where:
Cx = 3(x1 - x0)
Bx = 3(x2 - x1) - Cx
Ax = x3 - x0 - Cx - Bx
or in a single line:
x(t) = (x3 - 3x2 + 3x1 - x0)t3 + 3(x2 - 2x1 + x0)t2 + 3(x1 - x0)t + x0
Y and even Z (if in
3D) are exactly the same.
y(t) = Ayt3 + Byt2 + Cyt + y0
y(t) = (y3 - 3y2 + 3y1 - y0)t3 + 3(y2 - 2y1 + y0)t2 + 3(y1 - y0)t + y0
z(t) = Azt3 + Bzt2 + Czt + z0
z(t) = (z3 - 3z2 + 3z1 - z0)t3 + 3(z2 - 2z1 + z0)t2 + 3(z1 - z0)t + z0
If derived, the equations can then be used to find the relative
velocity of the object.
vx(t) = 3Axt2 + 2Bxt + Cx
...and again for the
acceleration.
ax = 6Axt + 2Bx