Visualizing the Bezier curve: an approach provided by Geogebra and the CAS Maple
Transcript of Visualizing the Bezier curve: an approach provided by Geogebra and the CAS Maple
1
Visualizing the Bezier curve: an approach provided by Geogebra and
the CAS Maple
Francisco Regis Vieira alves – [email protected]
Abstract: Admittedly, in Algebraic Geometry we observe an abstract and formalist character.
In a specific way, the classical problem relatively to find a parameterization to an algebraic
curve is traditionally discussed in the literature. However, a computational approach permits
obtain an approximation, when we take a set of control points. In this paper, we discuss aspects
and application of the Bezier curve. This approach is described by P. Bézier and P. Casteljau.
We will show some preliminary examples and, in these cases, we can obtain a graphical and
dynamical interpretation by the Dynamic System Geogebra – DSG. On the other hand, we will
describe a way that permits to visualize a Bézier curves with a larger quantity of control points.
For some situations, we obtain the final curve supported by the CAS Maple.
Key-words: Bezier curve, Visualization, Geogebra, CAS Maple.
1. Introduction
There are many problems in Algebraic Geometry linked to the question to find a
specific parameterization for an algebraic plane curve described by the
condition ( , ) 0f X Y = . Moreover, if we have a rational parameterization, there is
possible to indicate its description in terms of Cartesian coordinates. Unfortunately, in
some cases, we must find a curve that passes through some specific points.
In this way, Vainsencher (2009, p. 116) explains that “the Bezier´s curves can be used
with certain computational and aesthetic advantages. Are provided that now, we are
content with a rational curve that ‘visually adjust’ the graphic distribution of points”.
On the other hand, frequently we can obtain a parameterization for a particular algebraic
curve. In fact, lets consider two curves:
(i) 6 2 3 5 0x x y y− − = (ii) ( )( ) ( sin( )), (1 cos( ))t a t t a tβ = − − (YATES, 1947, p. 64)
In the first case, we can take 6 2 3 5 0x x y y− − = and given t IR∈ , we will find the
intersections points of C with the line y tx= . For this, we compute 6 2 3 5 6 2 3 5 6 3 5 5 50 ( ) ( ) 0 0x x y y x x tx tx x t x t x− − = ∴ − − = ↔ − − = . So, if we consider
5 3 5 3 50 ( ) 0x x x t t x t t≠ ∴ − − = ↔ = + . Finally, we still compute 4 6y tx t t= = + . So, we
obtain that 3 5 4 6( ) ( , )t t t t tα = + + . In the figure 1, with the DSG´s help, we can easily
describe its trace. However, we perceive some limitations, when we have considered the
Cartesians coordinates (on the left side). In fact, we can perceive a strange behavior near
at the origin. On the right side, however, we can obtain with DSG, the graphical
behavior from the parameterization form. While in the second case, we have considered
the Cycloid that represents a path of a point of a circle rolling upon a fixed line
(YATES, 1947, p. 64). Correspondingly also the first item, we can compare the both
representation related to the same mathematical object (see fig. 1).
In the next section, we will discuss some specific properties related to this object and,
specially, a recursive analytical method for obtain a Bezier curve of degree n.
2
Figure 1. Visualizing a graphical behavior of a algebraic curve.
2. Some considerations about the Bézier curve
When we considering 1 1 1 2 2 2 3 3 3( , ), ( , ), ( , ), , ( , )d d dP x y P x y P x y P x y= = = =… we seek a
rational curve which passes through of these points. Moreover, we need that the
tangents at these points containing the segments 1 2 2 3 3 4 1, , , , d dP P P P P P P P−… . On
the other hand, en virtue to understanding this basic construction, we need to talk some
information about the Bernstein’s polynomials. Indeed, we know the Bernstein’s
polynomials defined by ,
!( ) (1 ) (1 )
!( )!
i n i i n i
i n
n nB t t t t t
i i n i
− − = − = −
− , with 0 i n≤ ≤ .
(*).
So, a Bézier curve ( )r t of degree n is represented by ,
0
( ) ( )n
i i n
i
r t b B t=
=∑ under
condition0 1t≤ ≤ . We can conclude that a Bézier curve is a polynomial, the degree of which is one less than the number of control points.
A parameterization is obtained from a recursive way (VAINSENCHER, 2009, p. 116).
Indeed, we can start with the polygonal determined by the 1d − segments. We write 1
1 1 2
1
2 2 3
1
1 1
( ) (1 )
( ) (1 )
( ) (1 )d d d
t t P tP
t t P tP
t t P tP
σ
σ
σ − −
= − +
= − + = − +
�
. In the next step we must substitute each consecutives
pairs of polygonal by an interpolation. In our case, we take a parabola in the following
way:
2 1 1
1 1 2
2 1 1
2 2 3
2 1 1
2 2 1
( ) (1 ) ( ) ( )
( ) (1 ) ( ) ( )
( ) (1 ) ( ) ( )d d d
t t t t t
t t t t t
t t t t t
σ σ σ
σ σ σ
σ σ σ− − −
= − +
= − + = − +
�
. Lets consider the set of the points:
1 2 3 4( 1,1), (0, 0), ( 1.2, 1.2), (2, 1.5)P P P P= − = = − − = − . Easily, we find:
3
1
1 1 2
1
2 2 3
1
3 3 4
( ) (1 ) (1 ) ( 1,1) (0,0) ( 1,1 )
( ) (1 ) (1 )(0,0) ( 1.2, 1.2) ( 1.2 , 1.2 )
( ) (1 ) (1 )( 1.2, 1.2) (2, 1.5) (3.2 1.2, 0.3 1.2)
t t P tP t t t t
t t P tP t t t t
t t P tP t t t t
σ
σ
σ
= − + = − ⋅ − + ⋅ = − −
= − + = − + − − = − −
= − + = − − − + − = − − −
.
In the next step, we compute: 2 2 2
1
2 2 2
2
( ) (1 )( 1,1 ) ( 1.2 , 1.2 ) ( 2.2 2 1, 0.2 2 1)
( ) (1 )( 1.2 , 1.2 ) (3.2 1.2, 0.3 1.2) (4.4 2.4 ,0.9 2.4 )
t t t t t t t t t t t
t t t t t t t t t t t
σ
σ
= − − − + − − = − + − − − +
= − − − + − − − = − −. Finally, we
find the following parameterized cubic curve described by 3 2 2 3 2 3 2
1 1 1( ) (1 ) ( ) ( ) (6.6 6.6 3 1,1.1 0.6 3 1)t t t t t t t t t t tσ σ σ= − + = − + − − − + .
Figure 2. Visualizing a Bézier curve with four control points
We still take another the set of points: 1 2 3 4( 1, 0), (0, 0), (1, 2), (2, 0)Q Q Q Q= − = = = .
Following a similar procedure, we establish that:
1
1
1
2
1
3
( ) (1 )( 1,0) (0,0) ( 1,0)
( ) (1 )(0,0) (1,2) ( ,2 )
( ) (1 )(1,2) (2,0) (1 ,2 2 )
t t t t
t t t t t
t t t t t
σ
σ
σ
= − − + = −
= − + =
= − + = + −
.
We continue by the calculations
2 2
1
2 2
2
( ) (1 )( 1,0) ( , 2 ) ( , 2 )
( ) (1 )( , 2 ) (1 , 2 2 ) (2 , 4 4 )
t t t t t t t t
t t t t t t t t t t
σ
σ
= − − + =
= − + + − = − and,
finally, we obtain a Bezier cubic 3 2 2 2 2 3
1 ( ) (1 )( ,2 ) (2 , 4 4 ) ( ,6 6 )t t t t t t t t t t t tσ = − + − = + − .
In the figure 3, we show the dynamic construction associated to which of these
recursive parameterization for four control points. Moreover, we perceive in color red,
only the variation correspondingly to the restriction 0 1t≤ ≤ . In these cases, is easy to
obtain the final form of a Bezier cubic curve 3 ( )tα . On the other hand, incidentally, we
have found here only two Bezier cubic. Degree 3 or cubic are usually used in Computer
graphics (WATT, 2000).
4
Figure 3. Visualizing a Bézier curve with four control points
Figure 4. Farin (2002, p. 47 – 84) comments the Casteljau algorithm of a Bezier curve of degree six
and the Degree elevation process
We show an arduous work en virtue to describe and visualize a Bézier curve with nine
control points. On the left side, we have used the Casteljau´s algorithmic (FARIN, 2002,
p. 45) formally described in the following way
( )1 1
1
0
( ) (1 ) ( ) ( )1 e 0 i
( )
r r r
i i i
i i
P t t P t tP tr n n r
P t P
− −+
= − +≤ ≤ ≤ ≤ −
= en virtue to obtain the
recursive curves. And on the right side, we obtain the final trajectory related a (red)
curve from the set of control points{ }0 1 2 3 4 5 6 7 8 9, , , , , , , , ,P P P P P P P P P P . We have
considered nine arbitrary points. From the specialized literature, we know that a Bezier
curve is contained within the convex hull of its control points (FARIN, 2002, p. 60).
(see figure 6). Farin (2002, p. 16) explains that “the convex combination points is
always inside those points, which is an observation that leads to the definition of the
convex hull of a point set: this is the set that is formed by all convex combination of a
point set”. In the figure 7, with the CAS Maple, we can understanding that is impossible
to make this process with a larger control points, without the actual technology.
5
Figure 5. Visualizing a Bézier curve with nine control points with DSG
Figure 6. Visualizing the convex hull related to a Bezier curve
6
Formally, a convex hull of the set of points 1 2( , ,..., )nX x x x= is defined to be the set
0 0 1 1
0
( ) | 1, 0n
n n i i
i
CH X a x a x a x a a=
= + + = ≥
∑� . From this formal definition, we just
enunciate the theorem (Convex hull property): Every point of a Bézier curve lies inside
the convex hull of its defining control points. In other words, for all [0,1]t ∈ ,
0 1 2( ) ( , , , , )nB t CH P P P P∈ … . A visualization provided by technology, we can acquire an
intuitive meaning for this definition and the formal theorem.
Figure 7. Analytical syntax required in the CAS Maple
3. Visualizing the degree elevation of Bézier curves
In this section, we will take a set of points { }0 1 2 1, , , , ,n n
P P P P P−… we apply the
Casteljau´s algorithimic en virtue to obtain a curve of degree n. From this, we desire to
describe another set of points { }0 1 2 1, , , , ,n n
Q Q Q Q Q +… and indicate a Bézier curve
of degree n+1. Well, we will use the following model
1 1 , i=0...n+11 1
i i i
i iQ P P
n n−
= + −
+ + (WATT, 2000, 69).
For exemplify this expression, we take the following control points:
0 1 2 3 4(0,0); (0, 4); (2, 4); (2,3); (1.5,3)P P P P P= = = = = . So, en virtue the expression
(**), we compute the new control set points:
0 0
1
2
3
4
5 4
(0, 0)
1 4 16(0, 0) (0, 4) (0, )
5 5 5
2 3 6(0, 4) (2, 4) ( , 4)
5 5 5
3 2 18(2, 4) (2, 3) (2, )
5 5 5
4 1 19(2, 3) (1.5, 4) ( , 3)
5 5 10
(1.5, 3)
Q P
Q
Q
Q
Q
Q P
= =
= + =
= + =
= + =
= + =
= =
7
Well, in the figure 8, on the right side, we can perceive the Bezier curve 5 ( )Q t . We still
observe that this curve is obtained from the following parameterization:
4
((1 - t) (2 (1 - t) t² + t (2 (1 - t) t + 2t)) + t ((1 - t) (2 (1 - t) t + 2t) + t (2 - 2t + t (2 - 1 / 2 t)))( )
(1 - t) ((1 - t) (4 (1 - t) t + 4t) + t (4 - 4t + t (4 - t))) + t ((1 - t) (4 - 4t +P t =
t (4 - t)) + t ((1 - t) (4 - t) + 3t)))
In some cases, when we dealing with a higher degree, this software manifests several
limitations relatively the algebraic computational en virtue to express the final curve.
Figure 8. Visualizing the elevation process with the DSG
4. Visualizing the reversing degree elevation of Bézier curves We find that the degree elevation process produces redundancy. On the other hand,
when we have a Bezier curve of degree n , is possible to obtain a Bezier curve of degree
1n − ? In the figure 9, we visualize this mathematical dynamical process.
Figure 9. Visualizing the process of reversing degree with Geogebra´s help
8
Let consider the control set points: 0 1 2 3(0, 0); (2, 6); (3, 0); (5, 4)Q Q Q Q= = = =
4 5 6; (7,1); (5,5); (10,6)Q Q Q= = = . We will follow the specific procedure:
( ) ( )
0 0
1 1 0
2 2 1
3 3 2
(0, 0)
6 1 6 1(2, 6) (0, 0) (2.4, 7.2)
5 5 5 5
6 2 6 2 12 36(3, 0) ( , ) (3.3, 3.6)
4 4 4 4 5 5
6 12 (5, 4) 1 (3.3, 3.
3 5
P Q
P Q P
P Q P
P Q P
= =
= − = − =
= − = − = −
= − = − −
���
�� ���
��� ��
��� ���
( ) ( )
( ) ( )
4 4 3
5 5 4
6) (6.7,11.6)
6 43 (7,1) 2 (6.7,11.6) (7.6, 20, 2)
2 2
6 56 (5, 5) 5 (7.6, 20.2) ( 8,131)
1 1
P Q P
P Q P
=
= − = − = −
= − = − − = −
��� ���
��� ���
In this case, we have used that 1 , i=0,...,n-1i i i
n iP Q P
n i n i−
= +
− −
�� ����
(FARIN, 2002, p.
85). From a geometric point of view, we recall the description of Farin (2002, p. 81)
when explains that “one way to proceed in such a situation is to increase the flexibility
of the polygon by adding another vertex to it”. Moreover, the degree elevation process
can be viewed as a process to introduce redundancy (see figure 8). On the other hand,
the degree reduction process is very inaccurate (see figure 9). Indeed, “in general, exact
degree reduction is not possible” (FARIN, 2002, p. 85). For example, if we consider a
cubic with an inflexion point, we can not obtain a quadratic curve which is a bad
approximation.
5. Final remarks In this paper, we have discussed some properties and examples related to the Bézier
curves. This topic is discussed without much detail in the context of Algebraic
Geometry (VAINSENCHER, 2009, p. 116-117). So, in some cases, we showed in this
paper that is possible to realize the algorithmic computational related to this object.
However, when we dealing with a higher degree Bezier curve, we have to consider
some problems concerning to obtain the final parameterized curve (ser figure 5).
Indeed, we showed some examples relatively the parameterization of a Bezier curves
with nine control points. Its description is made possible by the use of the CAS Maple.
Moreover, we observe in each situation, a prominent rule of the Bernstein polynomials
(*). In fact, we always describe a Bezier curve as a finite combination of Bernstein
polynomials. From this fact, we apply one of the most important results in the
approximation theory (FARIN, 2002, p. 90).
Finally, in application context, we recall the words due to Farin (2002, p. 112) when we
observe that “according to Bezier, designers a Renault were quickly getting used to
manipulating control points of a curve in order to create a particular shape. Other
designers may not like the concept of control points and would prefer to manipulate
points on the curve directly”. His words indicate the possibilities of technological
application of Bezier curves (DEKKERS, 2010). Moreover, with regard to academic
education, we pointed out the importance of the students understand this mathematical
constructive process of obtaining plane and spaces curves (see figure 10) through
approximations (ALVES, 2014).
9
In fact, Farin (2002, p. 166) warns that “there is probably no “best” parameterization,
since any method can be defeated by a suitably chosen data set”. We can extract a
important pedagogical implication relatively to understanding the mathematical
knowledge supported by a constructive approach and has certain limitations.
Figure 10. Peters; Marsh, D & Jordan (2012, p. 123) discuss an computational approach of Bezier
curves in 3D
REFERENCES Alves, F. R. Vieira. (2014). Semiotic Register and the Internal Transition to Calculus:
Elements for a Didactic Engineer, Lima: Catholic University of Peru, Conference, 2014.
Barsky, A. Brian. (1998). A view of CAD/CAM a development period by Pierre Bezier.
Annals of the History of Computing, v. 20, nº2, 37-40.
Dekkers, Jeroen. (2010). Application of Bezier curves in Computer Aided Design.
Netherlands: Technische Universiteit Delft. Available in:
file:///C:/Documents%20and%20Settings/Regis/Meus%20documentos/Downloads/repo
rt.pdf
Farin, Gerald. (2002). Curves and surfaces for CAGD: a practical guide. Fifth edition.
Arizona: Arizona State University. Morgan Kaufman Publishers.
Peters, J. L; Marsh, D & Jordan, K. E. (2012). Computational Topology and
Counterexamples with 3D visualization of Bezier curves. Applied General Topology. V.
13, nº 2, 115-134.
Riskus, Alekss. (2006). Approximation of a cubic Bezier curve by a circular arcs and
vice versa. INFORMATION TECHNOLOGY AND CONTROL, v. 35, nº 4. 371-378.
Vainsencher, Irael. (2009). Introduction to Algebraic Curves. Rio de Janeiro: SBM.
Yates, Roberts. C. (1947). A handbook on Curves and their Properties. Michigan: An
Arbor.
Watt, Allan. (2000). 3D Computer Graphics. Boston: Pearson Educational Limited.