본문 펼치기
Received: 2014-11-12
Accepted: 2015-02-06
Online published: 2015-11-16
[DOI: http://dx.doi.org/10.15414/meraa.2015.01.02.49-55](http://dx.doi.org/10.15414/meraa.2015.01.02.49-55)
_<u>Math Educ Res Appl, 2015(1), 2, 49-55</u>_
_Original paper_
## Bezier curve and its application
Dušan Páleš <sup></sup> , Jozef Rédl
Slovak University of Agriculture, Faculty of Engineering, Department of Machine Design, Nitra,
Slovak Republic
ABSTRACT
<mark>Description of the Bezier curve is presented. We explain in detail creation of the calculation algorithm</mark>
<mark>together with the resulting program. It also includes drawing of the base functions of the Bernstein</mark>
<mark>polynomials. Firstly, the procedure is applied to the theoretical example given by ten control points in</mark>
<mark>a plane which approximate the Bezier curve. Secondly, the application in which we have given 138</mark>
<mark>points of trajectory of real vehicle. Points are located in space and we use them again for</mark>
<mark>approximation of the smooth Bezier curve.</mark>
KEYWORDS : Bezier curve, Bernstein polynomial, curve fitting.
JEL CLASSIFICATION: M55, N55
INTRODUCTION
<mark>The curves can be determined using control points, to which are usually added even further</mark>
<mark>restrictions, such as boundary conditions. The control points are used either to interpolate the</mark>
<mark>curve, when constructed smooth curve pass through all the given points, or to approximate</mark>
curve when smooth curve pass only some selected control points or goes off these points 1 .
<mark>Typical examples are the Lagrange interpolation, Hermite interpolation or Newton</mark>
<mark>interpolation. The best known approximation method is the approximation method of the least</mark>
<mark>squares. In this article we present approximation method using Bezier curve.</mark>
Corresponding author: Dušan Páleš, Slovak University of Agriculture, Faculty of Engineering, Department of
Machine Design, Tr. A. Hlinku 2, 949 76 Nitra, Slovak Republic. E-mail: dusan.pales@uniag.sk
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
MATERIAL AND METHODS
Bezier curve
Its name was given by French engineer Pierre Bezier, who worked at the French car factory
Renault. A simple algorithm for creating Bezier curve constructed competitor's employee of
Citroen Paul de Casteljau. Both designers have published their results in the sixties of the
previous century 6 . De Casteljau algorithm is based on the repeated use of linear
interpolation and generalize the construction of parabolic curves for higher orders.
Fig. 1 Illustration of the de Casteljau algorithm
for four-point control polynomial
P0 2,3 , P1 4,21 , P2 15,28 , P3 28,19
Source: Authors
Polygon was specified by four points in the plane as shown in the Figure 1 3 . Similarly, we
could have determined control points in space and the process would work analogously.
Bezier curve was expressed parametrically, the parameter t 0, 1 . Points of control
polygon we denoted as 0-th approximation point of the curve (subscript represents the serial
number of point and superscript approximation order)
P,P,P,P0 1 2 3 P00,P10,P20,P30 (1)
The first approximation is obtained from the zero approximation using relations
(1 t).P00
(1 t).P10
01(t) (1 t).P00 t.P10
11(t) (1 t).P10 t.P20
P01(t) (1 t).P00 t.P
P11(t) (1 t).P10 t.P
(1 t).P20 t.P30
21(t) (1 t).P20 t.P30 P01,P11,P21
P21(t) (1 t).P20 t.P30 P01,P11,P
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
(2)
50
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
And analogous continue the second and third approximation
(1 t).P01
02 (t) (1 t).P01 t.P11
P02 (t) (1 t).P01 t.P
(1 t).P11 t.P21
P12 (t) (1 t).P11 t.P21 P02,P12
(3)
P12 (t) (1 t).P11 t.P21 P02,P
P(t) P03(t) (1 t).P02 t.P12 P03 (4)
The point of the third approximation P03 is the point of the curve for entered parameter value
### t. This procedure should be repeated for each value t 1,0 . For t ,0 P (0) P 0 and for
_t_ ,1 _P_ )1( _P_ 3, therefore Bezier curve always passes through the first and the last point. If to
the relation (4) successively substitute relations (3), (2) and (1) we obtain the parametric
representation of the curve in the form
(1 t)3 .P0 3.(1 t)2.t.P1 (1 t).t 2 .P2 t 3 .P3
3 .P0 3.(1 t)2.t.P1 (1 t).t 2 .P2 t 3 .P3
P(t) (1 t)3 .P0 3.(1 t)2.t.P1 (1 t).t 2 .P2 t 3 .P3
## n 3 . 1
i 0 i
n
3 i i
## 3 . 1 t . t
## 1 t
i
i
i 0 i
i
3 i i
## 3 . 1 t . t .Pi
i
The parameter t appears at most in the cube, so it is a cubic Bezier curve. Repeat the
procedure creates a triangular approximation scheme of successive points
(5)
(6)
P00 P1 P10 P2 P20 P3
0 P00 P1 P10 P2 P20 P3 P30
P0 P00 P1 P10 P2 P20 P3 P
P01 P11 P21
P02 P12
3
0
P03 P(t)
RESULTS AND DISCUSSION
Numerical example for many control points
The process can be generalized to any number of control points of the polygon 4 . When the
polygon has _n_ 1 points it is necessary to perform n steps to get the point of the curve. Bezier
curve of degree n in the parametric representation has the form
_n_
#
## 1 t n i t 1
# p ( t ) n n 1 t n i t 1 P 1
_n_
_n_ _n_
# 1 t
1
# ( t ) 1 t n i t 1 P 1 (7)
_i_ 1 1
_i_
_n_
<sup></sup>
1
_i_
Tangent of the curve obtained at point P(t) is directly determined by points P0n-1, P1n-1, in the
case of our four-point polygon (6) hence by points P02, P12. The tangent at the starting point of
n-1, P1
Tangent of the curve obtained at point P(t) is directly determined by points P0
case of our four-point polygon (6) hence by points P02, P12. The tangent at the starting point of
the curve is the same as the first control edge of the polygon and in like manner tangent in the
last point of the curve is identical to the last control edge of the polygon.
Formula
_n_
#
## 1 t n i t 1
# p ( t ) n n 1 t n i t 1 P
_n_
_n_ _n_
# 1 t
1
# ( t ) 1 t n i t 1 P 1 (8)
_i_ 1 1
_i_
_n_
<sup></sup>
1
_i_
is called the Bernstein polynomial of degree n.
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
51
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
With it looks simply parametric writing of Bezier curve
_P_ ( _t_ ) _Bin_ ( _t_ ) <sup>_P_</sup> 1. (9)
Bernstein polynomials form a basis of the vector space for polygon degree at most n. They are
_<u>i</u>_
_t_ . In Figure 2 we
unimodal (dromedary) functions with a single maximum at the point _t_
_n_
present the Bernstein polynomials for _n_ 9 .
Fig. 2 Bernstein polynomials for n=9
Source: Authors
For _n_ 9 we chosen according to 2 ten points in the plane and developed an algorithm (10)
to calculate the Bezier curve with step parameter _t_ .005 . The number of points in the plane
as well as the step parameter can vary. For planar curve we use an algorithm twice in both
directions x and y. The selected control polygon and the resulting curve is shown in Figure 3.
k
Bezier _ Curve(n,tt,x): k 0
for t 0,tt...1
n
# k n! . 1 t n i .ti .xi
## i 0 i!. n i !
k 1
n
# k n! . 1 t n i .ti .xi
## i 0 i!. n i !
n
# BCk n! . 1 t n i .ti .xi
## i 0 i!. n i !
n
# n! . 1 t n i .ti .xi (10)
## i!. n i !
<u>n!</u>
## . 1 t n i !
k k 1
BC
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
52
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
Fig. 3 Bezier curve drawn for control points
P0 14,0 , P1 6,4 , P2 -4,16 , P3 4,19 , P4 14,30 , P5 16,30 ,
P6 26,19 , P7 5,16 , P8 24,4 , P9 16,0 ,
the parameter value tt=0.05
Source: Authors
Application of Beziér curve
The algorithm was used also in three dimensional space by application (10) in the directions
x, y and z 5 . We solved the real movement of the vehicle and record its position through 138
discrete points. These have served as control points for the Bezier curve. In Figure 4 we
present a polygon, which was created by connecting points with line segments and Figure 5
shows the Bezier curve, which smoothed sequence of movement of the vehicle.
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
53
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
Fig. 4 Original trajectory of vehicle from control points connected with lines
Source: Authors
Fig. 5 Approximated trajectory of vehicle by Beziér curve
Source: Authors
CONCLUSIONS
<mark>The resulting registration of the algorithm (10) proved to be relatively simple, regardless of</mark>
<mark>the number of control points</mark> _<mark>n</mark>_ <mark>and also of the parameter size</mark> _<mark>tt</mark>_ <mark>of Bezier curve. Curve fitting</mark>
<mark>can be done in a plane and in space as shown in the presented examples. Practical application</mark>
<mark>of the real movement of the vehicle in space replaced polygon composed from line segments</mark>
<mark>by smooth Bezier curve, for which there are not discontinuous points of the first derivation.</mark>
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
54
Mathematics in Education, Research and Applications (MERAA), ISSN 2453-6881
_<u>Math Educ Res Appl, 2015(1), 2</u>_
ACKNOWLEDGEMENT
The research performed at the Department of Machine Design of the Faculty of Engineering
of the Slovak University of Agriculture in Nitra was supported by the Slovak Grant Agency
for Science under grant VEGA No. 1/0575/14 titled “Minimizing the risks of environmental
factors in animal production buildings”.
REFERENCES
[1] Bastl, B. _Beziérove krivky_ . Plzeň: Západočeská univerzita v Plzni. [cit. 2014-12-18].
[Retrieved from http://geometrie.kma.zcu.cz/index.php/www/content/download/1152/3264/](http://geometrie.kma.zcu.cz/index.php/www/content/download/1152/3264/%20%20%20file/GPM_Bezier.pdf?PHPSESSID=05c59e8bf9cc6c31b703704908efa66e)
[file/GPM_Bezier.pdf?PHPSESSID=05c59e8bf9cc6c31b703704908efa66e](http://geometrie.kma.zcu.cz/index.php/www/content/download/1152/3264/%20%20%20file/GPM_Bezier.pdf?PHPSESSID=05c59e8bf9cc6c31b703704908efa66e)
[2] Macková, B. and Zaťková, V. (1985). _Riešenie základných úloh z deskriptívnej geometrie_
_pomocou počítača_ . Bratislava: SVŠT Bratislava.
[3] Sederberg, T. W. (2012). _Computer Aided Geometric Design Course Notes_ . Brigham
Young University, 262 p. [cit. 2014-12-18]. Retrieved from
[http://cagd.cs.byu.edu/~557/text/cagd.pdf](http://cagd.cs.byu.edu/~557/text/cagd.pdf)
[4] Shene, C. K. (2014). _Introduction to Computing with Geometric Notes_ . Department of
Computer Science, Michigan Technological University. [cit. 2014-12-18]. Retrieved from
[http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/](http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/)
[5] Rédl J., Páleš D., Maga J., Kalácska G., Váliková V., Antl J. (2014). Technical Curve
Approximation. Mechanical engineering letters. Szent István University, Gödöllö.
Reviewed by
1 Milada Balková, Slovak University of Agriculture, Faculty of Engineering, Department of Buildings,
Tr. A. Hlinku 2, 949 76 Nitra, Slovak republic
2 Ingrid Karandušovská, Slovak University of Agriculture, Faculty of Engineering, Department of Buildings, Tr.
A. Hlinku 2, 949 76 Nitra, Slovak republic
Slovak University of Agriculture in Nitra :: Department of Mathematics, Faculty of Economics and Management :: 2015
55