CurveFitting - Maple Help

Home : Support : Online Help : Mathematics : Numerical Computations : Interpolation and Curve Fitting : CurveFitting Package : CurveFitting/BSplineCurve

CurveFitting

 BSplineCurve
 compute a B-spline curve

 Calling Sequence BSplineCurve(xydata, v, opts) BSplineCurve(xdata, ydata, v, opts)

Parameters

 xydata - list, Array, or Matrix of the form [[x1,y1], [x2,y2], ... , [xn,yn]]; data points xdata - list, Array, or Vector of the form [x1, x2, ..., xn]; independent values ydata - list, Array, or Vector or the form [y1, y2, ..., yn]; dependent values v - name opts - (optional) one or more equations of the form order=k or knots=knotlist

Description

 • The BSplineCurve routine computes a B-spline curve based on the control points $\left\{\left(\mathrm{x1},\mathrm{y1}\right),\left(\mathrm{x2},\mathrm{y2}\right),...,\left(\mathrm{xn},\mathrm{yn}\right)\right\}$.  The resulting curve is in parametric form $\left[\mathrm{xf}\left(v\right),\mathrm{yf}\left(v\right),v=a..b\right]$, where $\mathrm{xf}\left(v\right)$ and $\mathrm{yf}\left(v\right)$ are piecewise functions of v, and $a..b$ is the range over which the B-spline curve is defined.
 • The BSplineCurve routine can be called in two ways.
 The first form accepts a list, Array, or Matrix, $[[\mathrm{x1},\mathrm{y1}],[\mathrm{x2},\mathrm{y2}],...,[\mathrm{xn},\mathrm{yn}]]$, of data points.
 The second form accepts the input data as two lists, two Arrays, or two Vectors. In this form, the first set of data contains the independent values, $[\mathrm{x1},\mathrm{x2},...,\mathrm{xn}]$, and the second set of data contains the dependent values, $[\mathrm{y1},\mathrm{y2},...,\mathrm{yn}]$.  Each element must be of type algebraic.
 • A cubic (order 4) B-spline curve is produced, unless the order=k (where $0 ) option is provided. An order k B-spline curve has polynomial pieces of degree less than k.
 • A uniform knot list is used by the procedure, but a different knot list can be specified using the knots=knotlist option.  The list knotlist must contain exactly $n+k$ values.  These values must be in nondecreasing order; otherwise, unexpected results may be produced.  If the knots=knotlist option is the only option provided, then an order 4 B-spline is assumed.  Knots can have a multiplicity up to $k-1$.  If the multiplicity of a knot is m, then the continuity at that knot is $C\left(k-m-1\right)$.
 • The B-spline curve is defined only on the range $v={\mathrm{knotlist}}_{k}\mathrm{...}{\mathrm{knotlist}}_{n+1}$.  For any value of v in this range, all k blending functions are present in the B-spline curve.  These blending functions are computed by the CurveFitting[BSpline] procedure.
 • This function is part of the CurveFitting package, and so it can be used in the form BSplineCurve(..) only after executing the command with(CurveFitting).  However, it can always be accessed through the long form of the command by using CurveFitting[BSplineCurve](..).

Examples

The following example produces a cubic (order 4) B-spline curve using a uniform knot list.

 > $\mathrm{with}\left(\mathrm{CurveFitting}\right):$
 > $\mathrm{xydata}≔\left[\left[0,0\right],\left[1,1\right],\left[4,9\right],\left[6,10\right],\left[8,5\right],\left[8,3\right]\right]$
 > $\mathrm{c1}≔\mathrm{BSplineCurve}\left(\mathrm{xydata},v\right)$

Use the plot command to see the resulting curve on the defined range, along with the boundary defined by the input points.

 > $\mathrm{plot}\left(\left\{\mathrm{c1},\mathrm{xydata}\right\}\right)$

The next example produces a quadratic (order 3) B-spline from the same input points, but with multiply-defined knot values.

 > $\mathrm{c2}≔\mathrm{BSplineCurve}\left(\mathrm{xydata},v,\mathrm{order}=3,\mathrm{knots}=\left[0,0,1,2,3,3,4,5,6\right]\right)$
 > $\mathrm{plot}\left(\left\{\mathrm{c2},\mathrm{xydata}\right\}\right)$