Professional Documents
Culture Documents
Drawing Bezier Curves: Assignment On
Drawing Bezier Curves: Assignment On
Drawing Bezier
Curves
Submitted To Submitted By
DCSA, KUK
MCA 4thSem
Equivalently, we
can define Bezier blending functions with the recursive calculation
#include <math.h>
#include graphics.h
Int k , i;
c[kl = 1;
c|k| * = i ;
c|k| = i ;
void computepoint
int k , n = n Controls -1 ;
float blend;
int i;
free (c);
Points to Remember
The Curve, in general, does not pass through any of the control
points except the first and last. From the formula B(0)= P0 and
B(1)= Pn.
The Curve is always contained within the convex hull of the
control points, it never oscillates wildly away from the control
points.
If there is only one control point P0, i.e. N= 0 then B(u) = P0 for
all u.
If there are only two control points P0 and P1, i.e. N= 1 then the
formula reduces to a line segment between the two control
points.
The blending function is always a polynomial one degree less
than the number of control points. Thus, 3 controls points result
in a parabola, 4 control points a cubic curve etc.
Closed curve can be generated by making the last control point
the same as the first control point. First order continuity can be
achieved by ensuring the tangent between the first two points
and the last two points are the same.
Adding multiple control points at a single position in space will
add more weight to that point pulling the Bezier curve towards
it.
P (0) = 6(P0-2P1+P2)
P (1) = 6(P3-2P2+P1)
P (0) = n (P1-P0)
P (1) = (Pn-Pn-1)
Second derivatives of the nth degree Bezier curve at the end points
can be calculated as
=n (n-1) (Pn-2-Pn-1)-(Pn-1-Pn)
C(t)= ___________________
i=0 Bi.P(t)Wi