Bezier Curve 1 PDF
Bezier Curve 1 PDF
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)
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
[]
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.
The parametric tangent vector of a cubic Bezier curve at any point t is obtained by differentiating
(1) with respect to t
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)
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.