Bézier curve
In the mathematical field of numerical analysis, a Bézier curve is a parametric curve important in computer graphics and related fields. 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 publicized in 1962 by the French engineer Pierre Bézier, who used them to design automobile bodies. The curves were first developed in 1959 by Paul de Casteljau using de Casteljau's algorithm, a numerically stable method to evaluate Bézier curves.
In vector graphics, Bézier curves are an important tool used to model smooth curves that can be scaled indefinitely. Bézier curves are also commonly used over the time domain, particularly in animation and interface design. Thus, a Bézier curve is often used to describe or control the velocity over time of an object moving from A to B. For example, an icon might "ease-in-out" or follow a "cubic Bézier" in moving from A to B, rather than simply moving at a fixed number of pixels per step. Indeed, when animators or interface designers discuss the "physics" or "feel" of an operation, they often are referring to the particular Bézier curve used to control the velocity over time of the move in question.
Applications
Computer graphics
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.
Quadratic and cubic Bézier curves are most common; higher degree curves are more expensive to evaluate. When more complex shapes are needed, low order Bézier curves are patched together. This is commonly referred to as a "path" in programs like Adobe Illustrator or Inkscape. These poly-Bézier curves can also be seen in the SVG file format. To guarantee smoothness, the control point at which two curves meet must be on the line between the two control points on either side.
The simplest method for scan converting (rasterizing) a Bézier curve is to evaluate it at many closely spaced points and scan convert the approximating sequence of line segments. However, this does not guarantee that the rasterized output looks sufficiently smooth, because the points may be spaced too far apart. Conversely it may generate too many points in areas where the curve is close to linear. A common adaptive method is recursive subdivision, in which a curve's control points are checked to see if the curve approximates a line segment to within a small tolerance. If not, the curve is subdivided parametrically into two segments, 0 ≤ t ≤ 0.5 and 0.5 ≤ t ≤ 1, and the same procedure is applied recursively to each half. There are also forward differencing methods, but great care must be taken to analyse error propagation. Analytical methods where a spline is intersected with each scan line involve finding roots of cubic polynomials (for cubic splines) and dealing with multiple roots, so they are not often used in practice.
See also
- Vector graphics
- De Casteljau's algorithm
- Spline (mathematics)
- NURBS or Non-uniform rational B-spline
References
- Wikipedia contributors, "Bézier curves", Wikipedia, The Free Encyclopedia Accessed March 18, 2010
- Paul Bourke: Bézier Surfaces (in 3D), http://local.wasp.uwa.edu.au/~pbourke/geometry/bezier/index.html
- Donald Knuth: Metafont: the Program, Addison-Wesley 1986, pp. 123–131. Excellent discussion of implementation details; available for free as part of the TeX distribution.
- Dr Thomas Sederberg, BYU Bézier curves, http://www.tsplines.com/resources/class_notes/Bezier_curves.pdf
- J.D. Foley et al.: Computer Graphics: Principles and Practice in C (2nd ed., Addison Wesley, 1992)
External links
- Poly Bézier Curve Construction by jsDraw2D Graphics Library. The library is for JavaScript and is open source. The drawPolyBezier function in jsDraw2D implements the poly Bézier drawing algorithm.
- Don Lancaster's Cubic Spline Library describes how to approximate a circle (or a circular arc, or a hyperbola) by a Bézier curve; using cubic splines for image interpolation, and an explanation of the math behind these curves.
- Module for Bézier Curves by John H. Mathews
- Multi-degree 2D Bézier Curve java applet - An interactive bezier curve applet implementing: adding and deleting control points, showing control polygon and convex hull, manipulating sampling amount and elevating degree without changing the curve.
- PolyBezier – The Microsoft Win32 GDI API function, which draws Bézier curves in Windows graphic applications, like MS Paint.
- Finding All Intersections of Two Bézier Curves. – Locating all the intersections between two Bézier curves is a difficult general problem, because of the variety of degenerate cases. By Richard J. Kinch.
- SketchPad – A small program written in C and Win32 that implements the functionality to create and edit Bézier curves. Demonstrates also the use of de Casteljau's algorithm to split a Bézier curve.
- Bézier Curves interactive demo using ActionScript and FlashPlayer – Includes Bézier curve and additional drawing/text tools.
- Drawing Cubic Bézier Curves explained by using Flash Actionscript
- 3rd order Bézier Curves applet
- Living Math Bézier applet
- Living Math Bézier applets of different spline types, Java programming of splines in An Interactive Introduction to Splines
- From Bézier to Bernstein Feature Column from American Mathematical Society
- Bézier Curves demo using Flash Actionscript
- Bézier Curves drawer using C/Opengl
- Online experiments with the open source JavaScript library JSXGraph