| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Spline Toolbox |
| Contents | Index |
| Learn more about Spline Toolbox |
Having chosen to represent the rational spline
in this way
by the ordinary spline
makes it is easy to apply to a rational spline
all the fn... commands in the Spline Toolbox product,
with the following exceptions. The integral of a rational spline need
not be a rational spline, hence there is no way to extend fnint to
rational splines. The derivative of a rational spline is again
a rational spline but one of roughly twice the order. For that reason, fnder and fndir will
not touch rational splines. Instead, there is the command fntlr for
computing the value at a given x of all derivatives
up to a given order of a given function. If that function is rational,
the needed calculation is based on the considerations given in the
preceding paragraph.
The command r = rsmak(shape) provides rational splines in rBform that describe exactly certain standard geometric shapes , like 'circle', 'arc', 'cylinder', 'sphere', 'cone', 'torus'. The command fncmb(r,trans) can be used to apply standard transformations to the resulting shape. For example, if trans is a column-vector of the right length, the shape would be translated by that vector while, if trans is a suitable matrix like a rotation, the shape would be transformed by that matrix.
The command r = rscvn(p) constructs the quadratic rBform of a tangent-continuous curve made up of circular arcs and passing through the given sequence, p, of points in the plane.
A special rational spline form, called a NURBS, has become a standard tool in CAGD. A NURBS is, by definition, any rational spline for
which both
and
are in the same B-form, with each coefficient
for
containing explicitly the corresponding coefficient
for
as a factor:
![]()
The normalized coefficients
for the numerator spline are more
readily used as control points than the unnormalized coefficients
used in the
rBform. Nevertheless, this toolbox provides no special NURBS form,
but only the more general rational spline, but in both B-form (called rBform internally)
and in ppform (called rpform internally).
The rational spline circle used earlier is put together in rsmak by code like the following.
x = [1 1 0 -1 -1 -1 0 1 1]; y = [0 1 1 1 0 -1 -1 -1 0]; s45 = 1/sqrt(2); w =[1 s45 1 s45 1 s45 1 s45 1]; circle = rsmak(augknt(0:4,3,2), [w.*x;w.*y;w]);
Note the appearance of the denominator spline as the last component. Also note how the coefficients of the denominator spline appear here explicitly as factors of the corresponding coefficients of the numerator spline. The normalized coefficient sequence [x;y] is very simple; it consists of the vertices and midpoints, in proper order, of the "unit square". The resulting control polygon is tangent to the circle at the places where the four quadratic pieces that form the circle abut.
For a thorough discussion of NURBS, see [G. Farin, NURBS, 2nd ed., AKPeters Ltd, 1999] or [Les Piegl and Wayne Tiller, The NURBS Book, 2nd ed., Springer-Verlag, 1997].
![]() | rsform: rpform, rBform | The stform | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |