Skip to main content

Draw Bezier curve through 4 control points

Short answer

Use cubic Bezier blending: P(u)=(1−u)³P0+3u(1−u)²P1+3u²(1−u)P2+u³P3. Evaluate at u=0.5 gives (0.625,0.75). Curve passes through P0(0,0) and P3(2,3), shaped by control polygon without passing through P1,P2.

Given four 2-dimensional control points P0(0,0), P1(3,3), P2(-2,-2) and P3(2,3), draw a smooth curve using Bezier spline method.

Control points P0(0,0), P1(3,3), P2(−2,−2), P3(2,3). Four points give a cubic Bezier curve.

P(u) = (1−u)³P0 + 3u(1−u)²P1 + 3u²(1−u)P2 + u³P3

Power form: a = −P0 + 3P1 − 3P2 + P3 = (9 + 6 + 2, 9 + 6 + 3) = (17, 18); b = 3P0 − 6P1 + 3P2 = (−18 − 6, −18 − 6) = (−24, −24); c = −3P0 + 3P1 = (9, 9).

x(u) = 17u³ − 24u² + 9u, y(u) = 18u³ − 24u² + 9u

Blending values and points:

uB0B1B2B3xy
0100000
0.100.7290.2430.0270.0010.6770.678
0.250.42190.42190.14060.01561.0161.031
0.500.1250.3750.3750.1250.6250.750
0.750.01560.14060.42190.42190.4220.844
0.900.0010.0270.2430.7291.0531.782
1000123

Example, u = 0.5: x = 0.375·3 + 0.375·(−2) + 0.125·2 = 1.125 − 0.75 + 0.25 = 0.625; y = 0.375·3 + 0.375·(−2) + 0.125·3 = 1.125 − 0.75 + 0.375 = 0.75.

Drawing steps: plot the four control points and join them to form the control polygon. Plot the points in the table and join them smoothly in order of u.

 3 |                                o P3    o P1
   |
 2 |                        e
   |
 1 |                   d c  b
   |                     a
 0 |----------------o P0----------------------> x
   |
-1 |
   |
-2 |o P2
    -2              0       1       2       3

 a, b, c, d, e = curve points at u = 0.1, 0.25, 0.5, 0.75, 0.9
 curve order: P0 -> a -> b -> c -> d -> e -> P3

The curve leaves P0 along P0P1, goes out to about (1,1), turns back because of the pull of P2, and then moves up towards P3. It passes only through P0 and P3, not through P1 or P2.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 5 questions →