Hi guys, in this video we will learn Bernstein polynomials and also the
Bezier curves based on Bernstein polynomials. The name of this polynomials
named after Sergei Natanovich Bernstein. He is a Ukrainian and Soviet mathematician
of Jewish origin known for contribution to partial differential equations,
differential geometry, probability theory and approximation theory, so quite
complex, so cool, so smart to create so many equations let us to learn. Okay so
let's see the definition of Bernstein polynomials. They have a Bernstein basis
polynomial of a degree key are defined as like this way. So you can see first that
we look at they have three parameters. The first one we said t, we said the basis
polynomial is a function of t and i means i is from 0 to k and k is the
degree of this polynomial then we will know and here ki we called k choose i. So
this k choose i is the binomial coefficient so you have learned this
before and this is how to calculate k choose i and also in here k should
greater or equal than i and greater equal than 0. And you see this
is the basis polynomials and then this is how we calculate it then if we want
to get the Bernstein polynomials then this is the linear combination of
different basis functions. So B0, B1 to Bk we can call it a Bernstein coefficient
and use this coefficient then we can construct more complex and arbitrary
polynomials functions. And then let's see how to calculate it because if
when you look at this function and look at this in your brain like I so but
actually it's easy to compute it. Then we look at this from degree 0 then
this is the degree 0 and from 0 choose 0 then this is 1 based on the definition
of binomial coefficient and then this is also 0 0 so we get 1 and then if there
is degree 1 we will get we will choose from 1 choose 0 and there also
only have one choice right and then this is from 1 to this is 1 and then we can
get 1 minus t and if i equals to 1 then we get t so this means when the degree
equals to 1 then there have two option of the basics function and this depends on
the i equals to 0 and i equals to 1 and if the degree is 2 then we can get three
basic functions you see the i equals to 0, i equals to 1 and i equals to 2 then we
can use this function and you can calculate this by yourself then you can
understand better so then we can in this case we get this is actually is a
quadratic function and then this is also quadratic and this is three are different
and then if we want a third degree this then we can get a cubic function right
and then the i equals to 0 to 1 2 3 in this case so you can see when we use
Bernstein polynomials when the we choose different degree then this means in this
degree they have multiple basic functions and then if we want to draw
figure of this Bernstein polynomial let's see what's going on in here if the
polynomial of degree 1 you see the function if degree 1 then we have two
function 1 minus t and t so here have two lines that's the reason why we got
two lines and if there have a degree of two we have three basic functions and we
have 1 minus t square and we also have t square and we also have
2t multiply 1 minus t so here have three basic functions and have three curves
and for polynomial of degree 3 so we have four curves then you can see so we
use this polynomials and the Bernstein polynomials then they have different
basic function and this is an example if the degree is 15 then we can get this
way so this then this is the the space of polynomial of degree 15 now if we
summarize the properties of Bernstein polynomial and the first one is the best
property and we say the Bernstein basis polynomial they are linear independent
for this means for example that when the Bernstein polynomial of degree 2 there
have three basis functions but these three are linear independent and all of
them together they can form a base of the space of polynomials of degree less
than key and the other property is of the positivity so if we look at the
result again so for the degree 0 then the result is 1 and for the degree for
degree 1 and the sum of these two basic functions is 1 and if we look at the
degree of 2 then the sum of these three basic function is also 1 so so this is
the third property the sum of all the basic function with respect to one
degree the sum is equal to one and all the of them are positive yeah you can
see this from the curve all of them are equal or greater than 0 and the other
property is the recursivity of the Bernstein basis normials one polynomial
can always be written as a linear combination of polynomials of higher
degree you see this is a k minus 1 degree then you can use the linear
combination of 2k degree polynomial basis functions and with this the
coefficient okay so this is a Bernstein polynomials and based on this we can get
Bezier curves in Bernstein polynomials B0 to Bk this is a Bernstein coefficient
and if we make this coefficient meaningful then we call this coefficient
control points so then we use P to represent these control points P0 to Pn
and n we call it is the order of the Bezier curve and n equals to 1 this is a
linear Bezier curve and 2 is quadratic Bezier curve and so let's see the
animation then you can understand what's the meaning of meaningful so why these
control points are meaningful because these control points it can determine
the shape of these Bezier curves let's look at the first figure first you see
that this is do a function of time and the red one is the trajectory is the
curve and this the first one is the linear Bezier curve and it changes
along the time and P0 P1 and P2 P3 P4 these are the control points
if we only provide two control points and then the the curve is a straight line from P0 to P1
but if we change the position of P1 you see the curve the position of the Bezier curve also
change so the P0 and the P1 define the shape of the direction of the Bezier
curve in this case and if there have three control points then you see then if I change
the position of P2 then the shape of the Bezier curve also change but we know this the
the second order this is the second of Bezier curve so this is also based on the second degree
of Bernstein polynomials and for the Bernstein polynomials with degree 2 they have three basic
functions and the curve shape are parabola right and so here you see the result shape it is very
smooth and if we have four control points then you can we also can change the position of the
control points then we get a different shape so you can play around with it later I also put the
link in model then you can try later you see it's quite smooth and we usually always use the cubic
polynomials the third order of Bezier curve for a trajectory generation because the velocity the
acceleration and the jerk both of them are exist they can make sure the trajectory is quite smooth
but not only for trajectory generation they're also for font generation I mean the font in the
computer when you look at this sense in here they are also generated by these Bezier curves
PostScript it is the font created by Adobe company and PostScript is specified in terms
of a straight line and cubic Bezier curves they have a straight line and Bezier curves
and PostScript avoid the problem that fonts do not scale linearly at a small size and features
of the graphics will become proportionally too large or too small and then start to look
this pleasant but PostScript can solve this problem it can make the font still look very
clearly when we scale the font bigger or smaller at the beginning the type 1 font is charged and
then the type 3 is free but type 1 have more function of course but Adobe charges the fee
too high therefore to compete with the PostScript font, in April they created TrueType after one
year after the TrueType released then Adobe also make type 1 font free then for instance
for Lattice now we use Lattice to combine my lecture slides you also combine your assignment
sheet the fonts used in text is type 1 font for example we can have a look so for one pdf file
you can look at the properties and you can see all of them are type 1 because we use Lattice
not all so here also have type 3 this means there are some figures generated from other
library then embed into these slides then so there have other font type type 3 for example
if I you use pacing if you use pacing use a matplotlib then you save the figure into pdf
then the type of this figure the font on it is type 3 why I am familiar with this type is because
when we submit paper the IEEE submission system they cannot accept font type 3 font so every time
if we use pacing we use matplotlib to generate the figure and then afterwards we need to convert
the font type from type 3 to type 1 then we can submit the paper to the paper submission system
and so this is also some type 1 and type 3 okay go back so this post the script and TrueType
they are the two commonly used font type and of course this post the script it is based on the
cubic polynomials and the TrueType it is based on quadratic bezier curves and also combined with
some straight line and also apple cooperate with windows and then they create more useful and
quite common font such as the time new roman and time roman and aerial font we all also use this
very quite often so as I have told you this one is the font is the combination of a straight line
and the cubic bezier curves and the TrueType is a straight line the combination of the straight
line and the quadratic bezier curves the quadratic bezier curves are mathematically simpler
and faster to process than cubic bezier curves however most the shapes require
more points to describe with quadratic curves than cubics so both of them all of them they
have advantage and disadvantages and then now you know so what we learned how to generate
the trajectories we want to learn these spines and we know okay when we see multiple different
fonts on the computer and how to generate these fonts this also based on these curves these
splines okay good and then afterwards in next video we will learn basis spine this is also the
other commonly used splines