wiki-Bezier Curve

Source: Internet
Author: User
Tags cairo

Bezier CurveWikipedia, the free encyclopedia three-cubic Bezier curve

In the field of mathematical numerical analysis, Bezier curve, also known as Bezier curve (Bézier curve), is a very important parameter curve in computer graphics. The wider Bezier curve of the higher dimension is called a Bezier surface, where the Bezier triangle is a special instance.

The Bezier Curve was published in 1962 by the French engineer Pierre BesselPierre Bézier, who used the Bezier curve to design the body of the car. The Bezier curve was originally developed by Paul de Casteljau in 1959 using the de Casteljau algorithm to find the Bezier curve in a stable numerical way.

Directory[Hide]
  • 1 Example Description
    • 1.1 linear Bezier Curve
    • 1.2 two cubic Bezier curve
    • 1.3 three cubic Bezier curve
  • 2 Generalization
    • 2.1 Terminology
    • 2.2 Annotations
  • 3 Constructing Bezier curves
    • 3.1 Linear curve
    • 3.2 two times curve
    • 3.3 High- order curve
  • 4- litre order
  • 5 Applications
    • 5.1 Computer Graphics
  • 6 Examples of programs
  • 7 polynomial notation
  • 8 Rational Bezier curve
  • 9 See
  • Reference Literature
  • External links
[Edit] Example Description [edit] linear Bezier curve

Given the point p0,P1, the linear Bezier curve is just a straight line between two points. This line is given by the following formula:

And it is equivalent to linear interpolation.

[edit] two quadratic Bezier curve

The path of the quadratic Bezier curve is traced by the function B(t) of the given point p0,P1, andP2:

.

The TrueType font uses two Bezier curves that are made of Bézier splines.

[edit] three quadratic Bezier curve

P0,P1,P2,P34 points are defined in planar or in three-dimensional space with three quadratic Bezier curves. The curve starts at p 0 toward P 1 and comes from P 2 to p3. Generally do not go through P1 or P2; These two points are just there to provide direction information. The spacing between p0 and p1 determines how long the curve moves toward the p2 direction before turning to p3.

The parameter form of the curve is:

.

Modern imaging systems, such as PostScript, Asymptote, and Metafont, use three Bezier curves made of Bézier splines to depict the contours of a curve.

[edit] generalize

The Gebesel curve can be inferred as follows. The given point p0,P1 、...、pN, its Bezier curve is

.

For example:

.

The above formula can be expressed recursively as follows: The Bezier curve, which is determined by the point p0,P1 、...、pN. The

In ordinary words, the Bezier curve of the order, that is, the interpolation between the two-order Bezier curves.

Terminology [edit]

Some terms about parametric curves, there are

That is, the polynomial

Also known as the N -order Bernstein-base polynomial, defined 00 = 1.

Point Pi is called the control point of the Bezier curve. Polygons are joined with Bezier points with lines, starting at P0 and terminating with pn , called Bezier polygons (or control polygons ). The convex hull of a Bezier polygon (convex hull) contains Bezier curves.

[edit] notes
    • The curve that starts at p0 and ends at PN, the so-called endpoint interpolation property.
    • The sufficient and necessary condition for a curve to be a straight line is that all control points are bit on the curve. Similarly, the sufficient and necessary condition for a Bezier curve to be a straight line is the control point collinear.
    • The starting point (end point) of the curve is tangent to the first section of the Bezier polygon (the last section).
    • A curve can be cut at any point into two or any multi-stripe curve, and each sliver curve is still a Bezier curve.
    • Some seemingly simple curves (such as circles) cannot be precisely described by Bezier curves, or segmented into Bezier curves (although each internal control point is divided into four segments of the Bezier curve at the horizontal or vertical distance of the external control points on the unit circle, the maximum radius error that can be less than 1 per thousand is approximate to the circle).
    • A curve at a fixed offset (from a given Bezier curve), also known as an offset curve (false parallel to the original curve, such as an offset between two rails), cannot be precisely formed with Bezier curves (except for some trivial instances). In any case, the existing heuristics can usually give approximate values for practical purposes.
[edit] construct Bezier curves [edit] linear curve
Linear Bezier Presentation animation,T in [0,1]

The T in a linear Bezier function passes the curve described by B(t) from p0 to P1. For example, when t=0.25 ,B(t) is a line from point p0 to P1 path One-fourth. Like a continuous Tof 0 to 1,B(t) describes a line from p0 to P1.

[edit] two times curve

To construct a two-time Bezier curve, you can mediate points q0 and Q1 as a Tfrom 0 to 1:

    • The continuous point Q0 from p0 to P1 describes a linear Bezier curve.
    • The continuous point Q1 from P1 to P2 describes a linear Bezier curve.
    • A continuous point B(t) from q0 to Q1 that describes a two-time Bezier curve.
The structure of quadratic Bezier curves Quadratic Bezier curve demo animation,t in [0,1]
[edit] high- order curves

To construct higher-order curves, more intermediary points are needed. For three curves, the mediation point q0,q1,Q2, as described by the linear Bezier curve, and the points Rtwo,r0 described by the 1 curves are constructed:

Structure of three times Bezier curve Three-time Bezier curve demo animation,t in [0,1]

For four-times curves, the mediation points that can be described by linear Bezier curves are q0,q1,q2,Q3, points described by two Bezier curves, r0,R1, R2, and the point s0,s1, described by the three times Bezier curve, are constructed:

Structure of four times Bezier curve Four-time Bezier curve demo animation,t in [0,1]

(You can also refer to the composition of the five-order Bezier curve.) )

[edit]

The nth Bezier curve can be converted to a n+1 Bezier curve of exactly the same shape. This is useful when the software supports only a specific order of Bezier curves. For example, Cairo only supports three Bezier curves, and you can draw two Bezier curves in Cairo using the ascending order method.

We use this feature to make the ascending order. We multiply each item in the curve equation by (1− t) or T, so that each item rises to the first order. The following is an example of a second order ascending to a three-step

For any of the n values, we can use the following equation

Type and can be selected arbitrarily.

Therefore, the new control point is [1]

[edit] app [edit] computer graphics

Bezier curves are widely used in computer graphics to model smooth curves.

Two-and three-time Bezier curves are most common

examples of [edit] programs

The following code is a simple practical example of how to use C to mark a three-cubic Bezier curve. Note that the polynomial coefficients are simply computed here, and a series of T values from 0 to 1 are read, and in practice this is not generally the case, and recursive solutions are often faster-with more memory at the expense of less processor time. But straightforward methods are easier to understand and produce the same results. The following code has made the operation clearer. The optimization in practice calculates the coefficients once and uses them repeatedly in the loop of the actual calculation of curve points. Each time this is recalculated, the efficiency is lost, but the code is clearer and easier to read.

The calculation of a curve can draw a straight line on the connecting point on the curve array-the more points the more smooth the curve.

In some architectures, code can also be optimized for dynamic planning. For example,DT is a constant, andCX * T is equivalent to modifying a constant every time. After repeated application of this optimization, the loop can be rewritten without any multiplication (although the process is not a stable value).

/* Generate three-time code for the square-Bay line */typedefstruct{float x;Float y;}point2d;/* CP here is an array of four elements: Cp[0] As the starting point, or the P0 cp[1 in the image) as the first control point, or the P1 cp[2 in the image) as the second control point, or the P2 in the image above, as the end point, or the cp[3 T in the image as the reference value, 0 P3 t <= <= POINT2D Pointoncubicbezier(point2d* CP,Float T){Float AXBx, CX;float ay, by, CY;Float tsquared, tcubed; POINT2D result;/* Calculate multiple relationships */CX=3.0*(CP[1].X-CP[0].X); Bx=3.0*(CP[2].X-CP[1].X)-CX; Ax= CP[3].X-CP[0].X-CX-BX; Cy=3.0*(CP[1].Y-CP[0].Y); By=3.0*(CP[2].Y-CP[1].Y)-CY; Ay= CP[3].Y-CP[0].Y-CY-By;/* Calculate the curve of the value T */tsquared= T* t; Tcubed= tsquared* t; Result.X=(Ax* tcubed)+(BX* tsquared)+(CX* t)+ CP[0].X; Result.Y=(Ay* tcubed)+(By* tsquared)+*c;* t)+ CP[0].Y;return result;}/* Computebezier The line that is produced by the control point CP, fill in the array of the POINT2D structure. The caller must allocate enough memory to produce the results, which is <sizeof (POINT2D) numberofpoints>*/void Computebezier(point2d* CP,int numberofpoints, point2d* curve ) {float dt Span class= "Kw4" >int i; DT = 1.0 /-1  for (i = 0; I < numberofpoints++ curve [i] = pointoncubicbezier (CP *dt ) ;}     

Another kind of Bezier curve is used in animation, describing the object's motion path and so on. Here, the X and Y positions of the curve are not used to indicate the curve, but are used to represent the drawing position. When used in this form, the distance between successive points becomes more important, and most of them are not average proportions. The points will be strung closer, the control points closer to each point, and the more sparse control points will be scattered more open. If linear motion speed is required, further processing requires that the points be evenly dispersed by the desired path.

[edit] polynomial notation

Sometimes we might want to represent a Bezier curve as a polynomial, rather than a less straightforward Bernstein polynomial. Using the two-item theorem and the definition of a Bezier curve, the reorganization can be achieved by:

Here

It takes several calculations to calculate points on a curve, so it is more practical to calculate beforehand, but beware of high-order curves that may lack numerical stability (which is handled using the de Casteljau algorithm). Note that its empty product is 1.

[edit] rational Bezier curve

Rational Bessel adds an adjustable weight to provide a more approximate random shape. The numerator is the weighted Bernstein form of the Bezier curve, while the denominator is the sum of the weighted Bernstein polynomials.

Given the n + 1 control point Pi, the rational Bezier curve can be described as follows:

or a simple

[edit]
    • De Casteljau algorithm
    • Spline
    • Bezier Spline
    • Bezier surfaces
    • Bezier Triangle
    • Nurbs
    • String Art,bézier curves is also formed by many common forms of string art, where strings is looped across a frame of NA Ils.
    • Hermitian curve
[Edit] references
    • Paul Bourke: Bézier curves, http://astronomy.swin.edu.au/~pbourke/curves/bezier/
    • Donald Knuth: metafont:theprogram, Addison-wesley 1986, pp. 123-131. Excellent discussion of implementation details; Available 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)
    1. ^ Farin, Gerald, Curves and surfaces for computer-aided geometric design. 4, Elsevier Science & Technology Books . 1997, ISBN 978 0 12249054 5
[Edit] external links
    • Sanche Besel Curve applet(US)
    • Instant Math Bezier Applet(US)
    • Various spline types of instant math Bezier applets, spline Java program design in interactive intro spline (English)
    • Module for Bézier Curves by John H. Mathews(English)
    • Hermite and Bezier curve drawing method
    • Introduction to the Bezier curve of the Dipper

wiki-Bezier Curve

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.