In the mathematical subfield of numerical analysis a Bézier curve is a parametric curve important in computer graphics. A numerically stable method to evaluate Bézier curves is de Casteljau's algorithm. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case.
Bézier curves were widely publicised in 1962 by the French engineer Pierre Bézier who used them to design automobile bodies. The curves were developed in 1959 by Paul de Casteljau using de Casteljau's algorithm.
TrueType fonts use Bézier splines composed of the quadratic Bézier curves.
The parametric form of the curve is:
Modern imaging systems like PostScript, Asymptote and Metafont use Bézier splines composed of cubic Bézier curves for drawing curved shapes.
For example, for :
The points Pi are called control points for the Bézier curve. The polygon formed by connecting the Bézier points with lines, starting with P0 and finishing with Pn, that is, the convex hull of the Pi , is called the Bézier polygon, and the Bézier polygon contains the Bézier curve.
Bézier curves are widely used in computer graphics to model smooth curves. As the curve is completely contained in the convex hull of its control points, the points can be graphically displayed and used to manipulate the curve intuitively. Affine transformations such as translation, scaling and rotation can be applied on the curve by applying the respective transform on the control points of the curve.
The most important Bézier curves are quadratic and cubic curves. Higher degree curves are more expensive to evaluate. When more complex shapes are needed low order Bézier curves are patched together (obeying certain smoothness conditions) in the form of Bézier splines.
The resulting curve can be plotted by drawing lines between successive points in the curve array — the more points, the smoother the curve.
On some architectures, the code below can also be optimized by dynamic programming. E.g. since dt is constant, cx * t changes a constant amount with every iteration. By repeatedly applying this optimization, the loop can be rewritten without any multiplications (though such a procedure is not numerically stable).
/* Code to generate a cubic Bezier curve
typedef struct { float x; float y; } Point2D;
/* cp is a 4 element array where: cp* is the starting point, or P0 in the above diagram cp* is the first control point, or P1 in the above diagram cp* is the second control point, or P2 in the above diagram cp* is the end point, or P3 in the above diagram t is the parameter value, 0 <= t <= 1
Point2D PointOnCubicBezier( Point2D* cp, float t ) { float ax, bx, cx; float ay, by, cy; float tSquared, tCubed; Point2D result;
/* calculate the polynomial coefficients */
cx = 3.0 * (cp- cp[0.x); bx = 3.0 * (cp- cp[1.x) - cx; ax = cp- cp[0.x - cx - bx; cy = 3.0 * (cp- cp[0.y); by = 3.0 * (cp- cp[1.y) - cy; ay = cp- cp[0.y - cy - by; /* calculate the curve point at parameter value t */ tSquared = t * t; tCubed = tSquared * t; result.x = (ax * tCubed) + (bx * tSquared) + (cx * t) + cp*.x; result.y = (ay * tCubed) + (by * tSquared) + (cy * t) + cp*.y; return result; }
/*
ComputeBezier fills an array of Point2D structs with the curve
points generated from the control points cp. Caller must
allocate sufficient memory for the result, which is
void ComputeBezier( Point2D* cp, int numberOfPoints, Point2D* curve ) { float dt; int i;
dt = 1.0 / ( numberOfPoints - 1 );
for( i = 0; i < numberOfPoints; i++) curve* = PointOnCubicBezier( cp, i*dt ); }
Another application for Bézier curves is to describe paths for the motion of objects in animations, etc. Here, the x, y positions of the curve are not used to plot the curve but to position a graphic. When used in this fashion, the distance between successive points can become important, and in general these are not spaced equally — points will cluster more tightly where the control points are close to each other, and spread more widely for more distantly positioned control points. If linear motion speed is required, further processing is needed to spread the resulting points evenly along the desired path.
The rational Bézier curve adds weights that can be adjusted. The numerator is a weighted Bernstein form Bézier curve and the denominator is a weighted sum of Bernstein polynomials.
Given n + 1 control points Pi, the rational Bézier curve can be described by:
Bézierova křivka | Bézierkurve | Curva de Bézier | Courbe de Bézier | 베지에 곡선 | Curva Bézier | Bezjė kreivė | Béziercurve | ベジェ曲線 | Bézier-kurve | Krzywa Béziera | Curva de Bézier | Кривая Безье | Bézierjeva krivulja | เส้นโค้งเบซิเยร์
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Bézier curve".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world