On-Line Geometric Modeling Notes

A Matrix Formulation of the
Cubic Bezier Curves


Overview

A cubic Bézier curve has a useful representation in a matrix form. This is a non-standard representation but extremely valuable if we can multiply matrices quickly. The matrix which we develop, when examined closely, is uniquely defined by the cubic Bernstein polynomials. We can use this form to develop ``subdivision matrices'' that allow us to use matrix multiplication to generate different Bézier control polygons for the cubic curve.

To get a postscript version of these notes look here.


Developing the Matrix Equation

A cubic Bézier Curve can be written in a matrix form by expanding the analytic definition of the curve into its Bernstein polynomial coefficients, and then writing these coefficients in a matrix form using the polynomial power basis. That is,
 equation23
and so a cubic Bézier curve is can be written in a matrix form of
displaymath40
where
displaymath46
The matrix M defines the blending functions for the curve tex2html_wrap_inline397 - i.e. the cubic Bernstein polynomials. In reality there are three equations here, one for each of the x, y and z components of tex2html_wrap_inline405.

Utilizing equipment that is designed for fast tex2html_wrap_inline407 matrix calculations, this formulation can be used to quickly calculate points on the curve.


Subdivision Using the Matrix Form  

Suppose we wish to generate the control polygon for the portion of the curve tex2html_wrap_inline409 where t ranges between 0 and tex2html_wrap_inline415 - subdivide the curve at the point tex2html_wrap_inline417. This can be done by defining a new curve tex2html_wrap_inline419 which is equal to tex2html_wrap_inline421. Clearly this new curve is a cubic polynomial, and traces out the desired portion of tex2html_wrap_inline423 as t ranges between 0 and 1. We can calculate the Bézier control polygon for tex2html_wrap_inline431 by using the matrix form of the curve tex2html_wrap_inline433.
equation60
where the matrix tex2html_wrap_inline435 is defined as
equation100
So tex2html_wrap_inline437 is a Bézier curve, with a control polygon given by
displaymath169

In the same way, we can obtain the Bézier control polygon for the second half of the curve - the portion where t ranges between tex2html_wrap_inline441 and 1. If we call this new curve tex2html_wrap_inline445, then
equation209
where
displaymath267
obtaining a matrix that can be applied to the original Bézier control points to produce Bézier control points for the second half of the curve.


Generating a Sequence of Bézier Control Polygons.  

Using matrix calculations similar to those above, we can generate an iterative scheme to generate a sequence of points on the curve. To do this, we need one additional S matrix. If we consider the portion of the cubic curve tex2html_wrap_inline449 where t ranges between 1 and 2, We generate the Bézier control points of tex2html_wrap_inline457 by reparameterization of the original curve - namely by replacing t by t+1 - to obtain
equation293
where, after some calculation, tex2html_wrap_inline463 is given by
displaymath319

Now, using a combination of tex2html_wrap_inline465, tex2html_wrap_inline467 and tex2html_wrap_inline469, we can produce Bézier control polygons along the curve similar to methods developed with divided differences. To see what I mean here, first notice that
displaymath471
This states that by applying tex2html_wrap_inline473 to obtain a Bézier control polygon for the first half of the curve, we can then apply tex2html_wrap_inline475 to this control polygon to obtain the Bézier control polygon for the second half of the curve.

Extending this, if we apply
displaymath477
(that is, apply tex2html_wrap_inline479 k times and then tex2html_wrap_inline483 i times), we obtain the Bézier control polygon for the portion of the curve where t ranges between tex2html_wrap_inline489 and tex2html_wrap_inline491. By repeatedly applying tex2html_wrap_inline493, we move our control polygons along the curve.


Summary

We have developed a matrix form for the cubic Bézier curve. Using reparameterization, we then developed matrices which enabled us to produce Bézier control polygons for sections of the curve, and to move from one Bézier control polygon to an adjacent for on the curve. These operations are extremely useful when utilizing hardware with geometry engines that multiply tex2html_wrap_inline495 matrices rapidly.


This document maintained by Ken Joy

Comments to the Author

All contents copyright (c) 1996, 1997
Computer Science Department,
University of California, Davis
All rights reserved.



Ken Joy
Thu Jul 24 12:12:37 PDT 1997