CSC214 ยท 2081 ยท 5 marks
Construct the Bezier curve with the following polygon vertices (control points): A(1,1), B(2,3), C(4,3), and D(6,4).
Construct the Bezier curve with the following polygon vertices (control points): A(1,1), B(2,3), C(4,3), and D(6,4). [5]
Bezier Curve Construction
Given
Control points (4 points โ cubic Bezier, degree $n = 3$):
- $P_0 = A(1, 1)$
- $P_1 = B(2, 3)$
- $P_2 = C(4, 3)$
- $P_3 = D(6, 4)$
Solution
Bezier / Bernstein Blending Functions
$$P(u) = \sum_{k=0}^{3} P_k , BEZ_{k,3}(u), \quad 0 \le u \le 1$$
$$BEZ_{k,3}(u) = \binom{3}{k} u^k (1-u)^{3-k}$$
| $k$ | Blending Function |
|---|---|
| 0 | $(1-u)^3$ |
| 1 | $3u(1-u)^2$ |
| 2 | $3u^2(1-u)$ |
| 3 | $u^3$ |
Parametric Equations
$$x(u) = 1(1-u)^3 + 6u(1-u)^2 + 12u^2(1-u) + 6u^3$$ $$y(u) = 1(1-u)^3 + 9u(1-u)^2 + 9u^2(1-u) + 4u^3$$
Point Computations
u = 0: $x = 1,; y = 1$
u = 0.2: $(1-u)=0.8$ $$x = 0.512 + 6(0.2)(0.64) + 12(0.04)(0.8) + 6(0.008)$$ $$= 0.512 + 0.768 + 0.384 + 0.048 = 1.712$$ $$y = 0.512 + 9(0.2)(0.64) + 9(0.04)(0.8) + 4(0.008)$$ $$= 0.512 + 1.152 + 0.288 + 0.032 = 1.984$$
u = 0.4: $(1-u)=0.6$ $$x = 0.216 + 6(0.4)(0.36) + 12(0.16)(0.6) + 6(0.064)$$ $$= 0.216 + 0.864 + 1.152 + 0.384 = 2.616$$ $$y = 0.216 + 9(0.4)(0.36) + 9(0.16)(0.6) + 4(0.064)$$ $$= 0.216 + 1.296 + 0.864 + 0.256 = 2.632$$
u = 0.5: $(1-u)=0.5$ (midpoint, useful check) $$x = 0.125 + 6(0.5)(0.25) + 12(0.25)(0.5) + 6(0.125)$$ $$= 0.125 + 0.75 + 1.5 + 0.75 = 3.125$$ $$y = 0.125 + 9(0.5)(0.25) + 9(0.25)(0.5) + 4(0.125)$$ $$= 0.125 + 1.125 + 1.125 + 0.5 = 2.875$$
u = 0.6: $(1-u)=0.4$ $$x = 0.064 + 6(0.6)(0.16) + 12(0.36)(0.4) + 6(0.216)$$ $$= 0.064 + 0.576 + 1.728 + 1.296 = 3.664$$ $$y = 0.064 + 9(0.6)(0.16) + 9(0.36)(0.4) + 4(0.216)$$ $$= 0.064 + 0.864 + 1.296 + 0.864 = 3.088$$
u = 0.8: $(1-u)=0.2$ $$x = 0.008 + 6(0.8)(0.04) + 12(0.64)(0.2) + 6(0.512)$$ $$= 0.008 + 0.192 + 1.536 + 3.072 = 4.808$$ $$y = 0.008 + 9(0.8)(0.04) + 9(0.64)(0.2) + 4(0.512)$$ $$= 0.008 + 0.288 + 1.152 + 2.048 = 3.496$$
u = 1.0: $x = 6,; y = 4$
Summary Table
| $u$ | $x(u)$ | $y(u)$ |
|---|---|---|
| 0.0 | 1.000 | 1.000 |
| 0.2 | 1.712 | 1.984 |
| 0.4 | 2.616 | 2.632 |
| 0.5 | 3.125 | 2.875 |
| 0.6 | 3.664 | 3.088 |
| 0.8 | 4.808 | 3.496 |
| 1.0 | 6.000 | 4.000 |
The curve starts at $A(1,1)$, ends at $D(6,4)$, and remains within the convex hull of the control polygon, tangent to $AB$ at the start and to $CD$ at the end.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.