The parametric expression of a cubic Bezier[Artificial Intelligence]
Now, the de Casteljau algorithm by itself is not very useful in drawing a cubic Bezier curve, since this would require the computation of a large number of the points on the curve for obtain a certain precision. Nevertheless, for further practical exploitation of the Bezier curves, the parametric expression of the coordinates of points on a cubic Bezier curve is necessary.Let's start by note that the point D that divides the EF segment in a t/(1-t) ratio has the coordinates given by the expressions:
Dx = (1-t)•Ex+t•Fx and Dy = (1-t)•Ey+t•Fy (1)
Since the expressions for the x and y coordinates are similar, in the followings the non-indexed notation will be used as a shortcut for expressions (1) above: D = (1-t)•E + t•F (1')
With this notation:
- after the step 1, the A, B and C coordinates will be:
A = (1-t)•P1 + t•C1
B = (1-t)•C1 + t•C2
C = (1-t)•C2 + t•P2 - after step 2, the M and N coordinates will be:
M = (1-t)•A + t•B = (1-t)2•P1 + 2•(1-t) •t•C1 + t2•C2
N = (1-t)•B + t•C = (1-t)2•C1 + 2•(1-t) •t•C2 + t2•P2 - after step 3, the coordinates of the P point will be:
P = (1-t)•M + t•N = (1-t)3•P1 +
+ 3•(1-t)2•t•C1 + 3•(1-t)•t2•C2 + t3•P2
P = (1-t)3•P1 + 3•(1-t)2•t•C1 + 3•(1-t)•t2•C2 + t3•P2 (3)
with t taking values in the [
is called the parametric expression of a cubic Bezier curve.with t taking values in the [
0
, 1
] interval For example, applying the expression (3) for a
0.5
parameter value, results in:midc = (P1 + 3•C1 + 3•C2 + P2)/8 (4)
for the location of the middle point of a Bezier curve.[Note] The Coordinate A may be calculated for both Ax, Ay.
(P1x,P1y) - Starting Point.
(P2x,P2y) - Ending Point.
(Cx,Cy) - Common Intermediate Points.
No comments:
Post a Comment