# Composite Bézier curve – Wikipedia Beziergon – The red beziergon passes through the blue vertices, the green points are control points that determine the shape of the connecting Bézier curves

In geometric modelling and in computer graphics, a composite Bézier curve is a piecewise Bézier curve that is at least continuous. In other words, a composite Bézier curve is 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. Depending on the application, additional smoothness requirements (such as C1 or C2 continuity) may be added.

A continuous composite Bézier is also called a polybezier, by similarity to polyline, but whereas in polylines the points are connected by straight lines, in a polybezier the points are connected by Bézier curves. A beziergon (also called bezigon) is a closed path composed of Bézier curves. It is similar to a polygon in that it connects a set of vertices by lines, but whereas in polygons the vertices are connected by straight lines, in a beziergon the vertices are connected by Bézier curves. Some authors even call a C0 composite Bézier curve a “Bézier spline”; the latter term is however used by other authors as a synonym for the (non-composite) Bézier curve, and they add “composite” in front of “Bézier spline” to denote the composite case.

Perhaps the most common use of composite Béziers is to describe the outline of each letter in a PostScript or PDF file. Such outlines are composed of one beziergon for open letters, or multiple beziergons for closed letters. Modern vector graphics and computer font systems like PostScript, Asymptote, Metafont, OpenType, and SVG use composite Bézier curves composed of cubic Bézier curves (3rd order curves) for drawing curved shapes. Sinc function approximated using a smooth Bézier spline, i.e., a series of smoothly-joined Bézier curves

## Smooth joining

Composite Bézier curves can be smoothed to any desired degree of smoothness using Stärk’s construction.

C2 continuous composite cubic Bézier curves are actually cubic B-splines, and vice versa.

Individual curves are by definition C1 and C2 continuous. The geometric condition for C1 continuity when transiting across an endpoint joining two curves is that the associated control points are mutually opposed and collinear with the endpoint. The geometric condition for C2 continuity is C1 continuity, with the additional constraint that the control points are equidistant from the endpoint.

## Approximating circular arcs

In case circular arc primitives are not supported in a particular environment, they may be approximated by Bézier curves. Commonly, eight quadratic segments or four cubic segments are used to approximate a circle. It is desirable to find the length

${displaystyle mathbf {k} }$ of control points which result in the least approximation error for a given number of cubic segments.

### Using four curves

Considering only the 90-degree unit-circular arc in the first quadrant, we define the endpoints

${displaystyle mathbf {A} }$ and

${displaystyle mathbf {B} }$ with control points

${displaystyle mathbf {A’} }$ and

${displaystyle mathbf {B’} }$ , respectively, as:

{displaystyle {begin{aligned}mathbf {A} &=[0,1]mathbf {A’} &=[mathbf {k} ,1]mathbf {B’} &=[1,mathbf {k} ]mathbf {B} &=[1,0]end{aligned}}} From the definition of the cubic Bézier curve, we have:

${displaystyle mathbf {C} (t)=(1-t)^{3}mathbf {A} +3(1-t)^{2}tmathbf {A’} +3(1-t)t^{2}mathbf {B’} +t^{3}mathbf {B} }$ With the point

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

{displaystyle {begin{aligned}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}}/2end{aligned}}} Solving these equations for the x-coordinate (and identically for the y-coordinate) yields:

${displaystyle {frac {0}{8}}mathbf {+} {frac {3}{8}}mathbf {k} +{frac {3}{8}}+{frac {1}{8}}={sqrt {2}}/2}$ ${displaystyle mathbf {k} ={frac {4}{3}}({sqrt {2}}-1)approx 0.5522847498}$ Note however that the resulting Bézier curve is entirely outside the circle, with a maximum deviation of the radius of about 0.00027.
By adding a small correction to intermediate points such as

{displaystyle {begin{aligned}mathbf {A’} &=[mathbf {k} +0.0009,1-0.00103]mathbf {B’} &=[1-0.00103,mathbf {k} +0.0009],end{aligned}}} the magnitude of the radius deviation to 1 is reduced by a factor of about 3, to 0.000068 (at the expense of the derivability of the approximated circle curve at endpoints).

### General case

We may compose a circle of radius

${displaystyle R}$ from an arbitrary number of cubic Bézier curves.
Let the arc start at point

${displaystyle mathbf {A} }$ and end at point

${displaystyle mathbf {B} }$ , placed at equal distances above and below the x-axis, spanning an arc of angle

${displaystyle theta =2phi }$ :

{displaystyle {begin{aligned}mathbf {A} _{x}&=Rcos(phi )mathbf {A} _{y}&=Rsin(phi )mathbf {B} _{x}&=mathbf {A} _{x}mathbf {B} _{y}&=-mathbf {A} _{y}end{aligned}}} The control points may be written as:

{displaystyle {begin{aligned}mathbf {A’} _{x}&={frac {4R-mathbf {A} _{x}}{3}}mathbf {A’} _{y}&={frac {(R-mathbf {A} _{x})(3R-mathbf {A} _{x})}{3mathbf {A} _{y}}}mathbf {B’} _{x}&=mathbf {A’} _{x}mathbf {B’} _{y}&=-mathbf {A’} _{y}end{aligned}}} ### Examples

TrueType fonts use composite Béziers composed of quadratic Bézier curves (2nd order curves). To describe a typical type design as a computer font to any given accuracy, 3rd order Beziers require less data than 2nd order Beziers; and these in turn require less data than a series of straight lines. This is true even though any one straight line segment requires less data than any one segment of a parabola; and that parabolic segment in turn requires less data than any one segment of a 3rd order curve.