0% found this document useful (0 votes)
155 views4 pages

Bezier Curve 1 PDF

Cubic Bezier curves are parametric curves defined by 4 control points (P0, P1, P2, P3) and a parameter t between 0 and 1. The curve passes through P0 when t=0 and P3 when t=1. P1 and P2 influence the shape for intermediate t values. Cubic Bezier curves have the properties that they lie within the convex hull of the control points and are tangent to the lines between P0-P1 and P3-P2 at the endpoints. Multiple cubic Bezier curves can be smoothly joined by matching endpoints and tangents between curves according to the equations provided.

Uploaded by

Ansuman Mahanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views4 pages

Bezier Curve 1 PDF

Cubic Bezier curves are parametric curves defined by 4 control points (P0, P1, P2, P3) and a parameter t between 0 and 1. The curve passes through P0 when t=0 and P3 when t=1. P1 and P2 influence the shape for intermediate t values. Cubic Bezier curves have the properties that they lie within the convex hull of the control points and are tangent to the lines between P0-P1 and P3-P2 at the endpoints. Multiple cubic Bezier curves can be smoothly joined by matching endpoints and tangents between curves according to the equations provided.

Uploaded by

Ansuman Mahanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Cubic Bezier Curve

For a set of 4 control points P0, P1, P2, P3 a parametric Bezier curve segment that will fit to those
points is mathematically defined by
i=3
P(t)=∑ Pi Bi ,3 (t ),0⩽t⩽1 ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ (1)
i=0

where B i ,3 ( t) are the Bezier blending function, also known as Bernstein Basic functions defined
as follows:
B i ,3 ( t)=C (3,i)t i (1−t)3−i
3!
C( 3,i)=
3−i!i!
Therefore expanding equ (1) we get,
P(t)=P 0 B0,3 ( t)+ P1 B1,3 (t)+ P2 B 2,3 (t)+ P3 B 3,3 (t)

Where B 0,3 (t)=


[ 3!
(0!)(3!)]t 0 (1−t)3=(1−t )3

B 1,3 (t)=
[ 3!
(1!)(2!)]t 1 (1−t)2=t(1−t)2

B 2,3 (t)=
[ 3!
(2!)(1!)]t 2 (1−t)1=t 2 (1−t)

B 3,3 (t)=
[ 3!
(3!)(0!)]t 3 (1−t)0=t 3

=> P(t)=(1−t)3 P0 +3 t (1−t )2 P1 +3 t 2 (1−t)P2 +t 3 P 3


=> P(t)=(−t 3 +3 t 2−3 t +1) P 0+(3 t 3−6 t 2+ 3t ) P1 +(−3 t 3+ 3t 2) P2 +t 3 P3 ⋯ ⋯ (2)
From equ (2) two things can be observed. First, the degree of the polynomial blending functions are
3 and therefore the degree of the Bezier curve segment is one less than the number of control points
used. Second, the Bezier curve segment in general passes through only the first control point P0,
and the last control point P3 as because P(t = 0) = P0 and P(t = 1) = P3.
This expression can be translated into the matrix from similar to those used to express Hermite
piece wise splines in the previous section, i.e. as,
P(t)=[F][B]
or P(t)=[T][M][B]
Here the basis functions matrix [F ]=[B 0,3 (t) B1,3 (t) B2,3 (t ) B 3,3 (t)]

[]
P0
P
The Bezier geometry matrix [B]= 1
P2
P3
[T ]=[t 3 t 2 t 1]

[ ]
−1 3 −3 1
3 −6 3 0
and the Bezier basis matrix [M ]=
−3 3 0 0
1 0 0 0
Therefore a cubic Bezier curve controlled by the points P0, P1, P2, P3 is
[ ][ ]
−1 3 −3 1 P0
P
P(t)=[t 3 t 2 t 1] 3 −6 3 0 1 ⋯ ⋯ ⋯ (3)
−3 3 0 0 P2
1 0 0 0 P3

Let us now look at the Bezier blending functions more closely. At t = 0 all the blending functions
have 0 value except B 0,3 (t) which has a value 1. And at t = 1, the only non zero function is
B 3,3 (t) with the value of 1. Thus end control points P0 and P3 contribute 100% to the shape of
the curve at t = 0 and 1 respectively. This ensures that the curve always passes through the first and
last control points. For other intermediate values of t between 0 and 1 all the control points partly
contribute to the curves shape, as well the blending functions are non-zero for 0<t<1. However in
the intermediate range of t, B 1,3 (t) and B 2,3 (t) displays higher values compared to B 0,3 (t)
and B 3,3 (t) implying a greater pull on the curve by P1 and P2. B 1,3 (t) Is maximum at t=1/3
while B 2,3 (t) is maximum at t=2/3.

None of the Bezier blending functions are negative at 0⩽t⩽1 , and sum all the blending functions
is unity everywhere. Thus the Bezier curve always lie completely within the convex hull (biggest
polygon obtainable within the given set of points)of the four control points.

The above three figures show, how the shape of the cubic Bezier curve changes depending on the
order of the four control points.

Tangents on Bezier Curve

The parametric equation of cubic Bezier curve is given by


P(t)=(−t 3 +3 t 2−3 t+1) P 0+(3 t 3−6 t 2+ 3t ) P1 +(−3 t 3+ 3t 2) P2 +t 3 P3 ⋯ ⋯ (1)

The parametric tangent vector of a cubic Bezier curve at any point t is obtained by differentiating
(1) with respect to t

P1 (t)=(−3t 2 +6 t−3)P0 +(9 t 2−12t +3) P1 +(−9t 2 +6 t) P2+ 3 t 2 P 3 ⋯ ⋯ (2)

Evaluating P1 (t) at the start point i.e. at t = 0 and at the end point i.e. at t = 1 give
1
P (0)=−3 P 0+ 3 P1 =3( P1−P0 ) ⋯ ⋯ ⋯ ⋯ (3)
1
P (1)=−3 P2 +3 P3=3(P 3−P2) ⋯ ⋯ ⋯ ⋯ (4)
Therefore the tangent to the curve at the endpoints are along the line joining the respective
endpoints to the adjacent control points.

[ If instead of four control points, the two endpoints and the endpoint tangents are given, a fitting
cubic Bezier curve can also be determined by finding two intermediate control points using (3) and
(4).]
The parametric second derivative of a cubic Bezier curve at any point t is obtained by
differentiating (2) with respect to t
11
P (t )=(−6 t + 6) P0 +(18 t−12) P1 +(−18 t+6) P2 +6 t P3 ⋯ ⋯ ⋯ (5)

Evaluating (5) at t = 0 and t = 1, we get

P11 (0)=6 P 0−12 P 1+ 6 P 2=6(P 0−2 P 1+ P2 ) ⋯ ⋯ ⋯ ⋯ (6)


11
P (1)=6 P1 +−12 P2 +6 P3=6 (P1−2 P2+ P 3) ⋯ ⋯ ⋯ ⋯ (7)

Conditions for Smoothly Joining cubic Bezier Curve Segments

For a given cubic Bezier Curve P(t) defined by four control points P0, P1, P2, P3 we can make a
second curve Q(t) that joins the first curve P(t) smoothly. Let the second curve Q(t) defined by four
control points Q0, Q1, Q2, Q3. As the Bezier curve passes through the end points, in order to connect
two adjacent cubic Bezier curve sections, the first control point of the second curve must coincide
with the last control point of the first curve. Its a zero order continuity. Therefore,
P 3 = Q0 ⋯ ⋯ ⋯ ⋯ (8)

If we want the above two curves join smoothly, it is required that the tangents to the both curves
have the same direction (G1 continuity) at the common endpoint. Therefore,
Q1 (0)=kP 1 (0) , k>0
=> 3(Q1−Q 0)=k 3(P3−P2 ) ⋯ ⋯ ⋯ ⋯ (9)
This means the three control points P2, P3= Q0, Q1 are collinear i.e. P3 = Q0 lie in the line joining
P2 and Q1. A better connection is established if P3 = Q0 lies in the middle of the line, then the
tangent vectors of the two curves P(t) and Q(t) at the common endpoints have same direction and
magnitude (C1 continuity). This implies k = 1. Therefore,
3(Q1−Q 0)=3 (P3−P2 )
=> P3 +Q 0=Q 1 + P2
=> Q1=2 P3−P2 [from equ (8)] ⋯ ⋯ ⋯ (10)
We cam further assume C2 continuity between the curve segments then
11 11
Q (0)=P (1)
=> 6(Q 0−2Q 1+Q2 )=6 ( P1−2 P 2+ P3 ) [from (6) and (7)]
=> Q2=P1 +2(Q1−P2 )
=> Q2=P1 +4 ( P3−P2 ) [from (10)] ⋯ ⋯ (11)
Thus we see that given a Bezier curve section defined by four control points, we can extend this
curve by constructing a second Bezier curve section in continuation by calculating the position of
the first three control points using the last three control points of the second curve by (8), (10), (11)
and arbitrarily fixing the position of the last control point of the second curve section. Similarly a
third section can be attached to the second curve section and so on to form a continuous piece-wise
Bezier curve using multiple control points, yet cubic in nature.

You might also like