Cubic Bezier Curves

[Graphics:HTMLFiles/index_1.gif]

Given

Starting and Ending Points and Tangents

P_0, P_1, P_2, P_3

General Form

P (t) = a_0 + a_1t + a_2t^2 + a_3t^3

/tP (t) = P^′ (t) = a_1 + 2a_2t + 3a_3t^2

Boundary Conditions

P (0) = a_0 = P_0

P^′ (0) = a_1 = 3 (P_1 - P_0)

P (1) = a_0 + a_1 + a_2 + a_3 = P_3

P^′ (1) = a_1 + 2 a_2 + 3 a_3 = 3 (P_3 - P_2)

Solving for the a_i

a_0 = P_0

a_1 = -3 P_0 + 3 P_1

a_2 = 3 P_0 - 6 P_1 + 3 P_2

a_3 = -P_0 + 3 P_1 - 3 P_2 + P_3

Substitutiing these a_iinto the "general form" above

P (t) = a_0 + a_1t + a_2t^2 + a_3t^3

= P_0 + 3 (-P_0 + P_1) t + 3 (P_0 - 2 P_1 + P_2) t^2 + (-P_0 + 3 P_1 - 3 P_2 + P_3) t^3

Rewriting

P (t) = ({{t^3, t^2, t, 1}}) . ({{-1, 3, -3, 1}, {3, -6, 3, 0}, {-3, 3, 0, 0}, {1, 0, 0, 0}}) . ({{P_0}, {P_1}, {P_2}, {P_3}})

Multiplying with right association leads directly to the previous expression. Multiplying with left association leads to an equicalent but slightly different form

P (t)

= P_0 + (-3 P_0 + 3 P_1) t + (3 P_0 - 6 P_1 + 3 P_2) t^2 + (-P_0 + 3 P_1 - 3 P_2 + P_3) t^3

= P_0 - 3 t P_0 + 3 t P_1 - 6 t^2 P_1 + 3 t^2 P_0 + 3 t^2 P_2 - t^3 P_0 + 3 t^3 P_1 - 3 t^3 P_2 + t^3 P_3

= (1 - t)^3P_0 + 3t (1 - t)^2P_1 + 3t^2 (1 - t) P_2 + t^3P_3

This is the Bezier Basis form.