Bézier spline

Share on Facebook Share on Twitter Email
Top

In the mathematical field of numerical analysis and in computer graphics, a Bézier spline is a spline curve where each polynomial of the spline is in Bézier form.

In other words, a Bézier spline is simply a series of Bézier curves joined end to end where the last point of one curve coincides with the starting point of the next curve. Usually cubic Bézier curves are used, and additional control points (called handles) are added to define the shape of each curve.

Contents

Definition

Sinc function approximated using Bézier splines

Given a spline S of degree n with k knots xi we can write the spline as a Bézier spline as: 
S(x) := \left\{
\begin{matrix}
    S_0(x) := & \sum_{\nu=0}^{n} \beta_{\nu,0} b_{\nu,n}(x) & x \in [x_0, x_1) \\
    S_1(x) := & \sum_{\nu=0}^{n} \beta_{\nu,1} b_{\nu,n}(x - x_1) & x \in [x_1, x_2) \\
       \vdots & \vdots \\
S_{k-2}(x) := & \sum_{\nu=0}^{n} \beta_{\nu,k-2} b_{\nu,n}(x - x_{k -2}) & x \in [x_{k-2}, x_{k-1}] \\
\end{matrix}\right.

Approximating circular arcs

In case circular arc primitives are not supported in a particular environment, they may be approximated by Bézier curves.[1] Commonly, four cubic segments are used to approximate a circle. It is desirable to find the length \mathbf{k} of control points which result in the least approximation error.

Using four curves

Considering only the 90-degree unit-circular arc in the first quadrant, we define the endpoints \mathbf{A} and \mathbf{B} with control points \mathbf{A'} and \mathbf{B'}, respectively, as:


\begin{align}
\mathbf{A} & = [0, 1] \\
\mathbf{A'} & = [\mathbf{k}, 1] \\
\mathbf{B'} & = [1, \mathbf{k}] \\
\mathbf{B} & = [1, 0] \\
\end{align}

From the definition of the cubic Bézier curve, we have:

\mathbf{C}(t)=(1-t)^3\mathbf{A} + 3(1-t)^2t\mathbf{A'}+3(1-t)t^2\mathbf{B'}+t^3\mathbf{B}

With the point \mathbf{C}(t=0.5) as the midpoint of the arc, we may write the following two equations:


\begin{align}
\mathbf{C} &= \frac{1}{8}\mathbf{A} + \frac{3}{8}\mathbf{A'}+\frac{3}{8}\mathbf{B'}+\frac{1}{8}\mathbf{B} \\
\mathbf{C} &= \sqrt{1/2} = \sqrt{2}/2
\end{align}

Solving these equations for the x-coordinate (and identically for the y-coordinate) yields:

\frac{0}{8}\mathbf + \frac{3}{8}\mathbf{k}+\frac{3}{8} + \frac{1}{8} = \sqrt{2}/2
\mathbf{k} = \frac{4}{3}(\sqrt{2} - 1) = 0.5522847498

General case

We may compose a circle of radius R from an arbitrary number of cubic Bézier curves.[2] Let the arc start at point \mathbf{A} and end at point \mathbf{B}, placed at equal distances above and below the x-axis, spanning an arc of angle \theta = 2\phi:

\begin{align}
\mathbf{A}_x &= \cos(\phi) \\
\mathbf{A}_y &= \sin(\phi) \\
\mathbf{B}_x &= \mathbf{A}_x \\
\mathbf{B}_y &= -\mathbf{A}_y
\end{align}

The control points may be written as:[3]

\begin{align}
\mathbf{A'}_x &= \frac{4 - \mathbf{A}_x}{3} \\
\mathbf{A'}_y &= \frac{(1 - \mathbf{A}_x)(3 - \mathbf{A}_x)}{3\mathbf{A}_y} \\
\mathbf{B'}_x &= \mathbf{A'}_x \\
\mathbf{B'}_y &= -\mathbf{A'}_y
\end{align}

Examples

References

  1. ^ Stanislav, G. Adam. "Drawing a circle with Bézier Curves". http://whizkidtech.redprince.net/bezier/circle/. Retrieved 10 April 2010. 
  2. ^ Riškus, Aleksas (October 2006). "APPROXIMATION OF A CUBIC BEZIER CURVE BY CIRCULAR ARCS AND VICE VERSA". INFORMATION TECHNOLOGY AND CONTROL (Department of Multimedia Engineering, Kaunas University of Technology) 35 (4): 371–378. ISSN 1392-124X. http://itc.ktu.lt/itc354/Riskus354.pdf. 
  3. ^ DeVeneza, Richard. "Drawing a circle with Bézier Curves". http://www.tinaja.com/glib/bezcirc2.pdf. Retrieved 10 April 2010. 
  • Koehler; Dr. Ralph. 2D/3D Graphics and Splines with Source Code. ISBN 0-7596-1187-4. 

Post a question - any question - to the WikiAnswers community:

Copyrights: