First attempt: Matching endpoints
Let us start with two Bézier curves that can be glued together but
otherwise are not well matched. Let the first curve have control points
,
,
,
and let the second curve
have control points
,
,
,
, as shown
in Figure
. Suppose that
. For
convenience let this point of joining also be called
;
i.e.,
. The result is shown in Figure
.
The curve has a corner, because at the first Bézier curve has
first derivative
and the other has first derivative
, but the vectors
and
do
not even have the same direction. (Recall that subtracting one point
from another, say
, gives the vector from
to
.)
Second attempt: Matching values and first derivatives
A much better join is obtained if we require that
, or equivalently, that
be the midpoint
of the line segment
, so that the first
derivatives match at the point of gluing. Figure
shows an example where this condition is met.
This example certainly looks smoother. However, it is still not ideal. Imagine taking a fast train ride along a track of this shape. On the first Bézier segment you are curving so that you are pushed against the left wall of the train; on the other you are curving the other way and are pushed against the right wall. At the point of joining you are jerked from one side of the train to the other. For an even smoother join, then, the curvature should be continuous. Because the curvature can be expressed in terms of the first and second derivatives, continuity of curvature can be achieved by matching second derivatives, as well as first derivatives, at the point of gluing.
Third attempt: Matching values, first derivatives, and second derivatives
Recall that at , where
for the first
Bézier curve and
for the other, the second
derivatives of the Bézier curves are respectively
and
. Thus we want
, or equivalently,
.
Here is an interesting way of interpreting this equation. Negate both
sides to get
. The motivation for
doing this is that both sides now have coefficients summing to 1
and so should represent points, independently of coordinatization.
The left-hand side corresponds to a particular point on
the line through
and
. In fact,
, as
shown in Figure
. Let us call
the right
apex of the first control polygon. Similarly, the right-hand
side of the equation is the left apex
of the second Bézier curve, as shown.
As you see, in this example the two apexes are not equal,
so the equation is not satisfied and the second derivatives at of the two Bézier curves still do not match. Figure
shows an example where they do match, with both
apexes being at a common point
:
The relevant part of Figure looks like the letter
or like an A-frame cabin.
Definition. An is a figure with points as indicated, in
which
is the midpoint of
,
is
the midpoint of
, and
is the midpoint
of
. An example is shown in Figure
.
Thus we see:
Observation. If two Bézier curves are joined at a point ,
both their first and second derivatives match at
if and only if their
control polygons fit an A-frame.
Note: Matching third derivatives as well sounds promising, but is not helpful, as it forces both curves to be parts of just one third-degree curve. Thus the flexibility obtained by gluing curves is lost. See the Exercises.