BSplineCurve - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


CurveFitting

  

BSplineCurve

  

compute a B-spline curve

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

BSplineCurve(xydata, v, opts)

BSplineCurve(xdata, ydata, v, opts)

Parameters

xydata

-

list, Array, DataFrame, or Matrix of the form [[x1,y1], [x2,y2], ... , [xn,yn]]; data points

xdata

-

list, Array, DataSeries, or Vector of the form [x1, x2, ..., xn]; independent values

ydata

-

list, Array, DataSeries, 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 {x1,y1,x2,y2,...,xn,yn}.  The resulting curve is in parametric form xfv,yfv,v=a..b, where xfv and yfv 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, [[x1,y1],[x2,y2],...,[xn,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, [x1,x2,...,xn], and the second set of data contains the dependent values, [y1,y2,...,yn].  Each element must be of type algebraic.

• 

A cubic (order 4) B-spline curve is produced, unless the order=k (where 0<k<=n+1 ) 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 k1.  If the multiplicity of a knot is m, then the continuity at that knot is Ckm1.

• 

The B-spline curve is defined only on the range v=knotlistk...knotlistn+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.

withCurveFitting&colon;

xydata0&comma;0&comma;1&comma;1&comma;4&comma;9&comma;6&comma;10&comma;8&comma;5&comma;8&comma;3

xydata0&comma;0&comma;1&comma;1&comma;4&comma;9&comma;6&comma;10&comma;8&comma;5&comma;8&comma;3

(1)

c1BSplineCurvexydata&comma;v

c10v<1v136v<256+v2+v222+v236v<3143+v32v332+2vv<4376+5v2v422+v436v<54+2vv533v<653+vv62v63v<710434v4v72+8v733v<810034v+4v824v833v<909v&comma;0v<1v136v<256+v2+v222+v23v<3343+7v3227v333+9v2v<4616+9v27v422+v436v<5192v3v52+3v532v<65327v2+3v6222v633v<76135v2v722+2v733v<82523v2+3v822v832v<909v&comma;v=3..6

(2)

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

plotc1&comma;xydata

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

c2BSplineCurvexydata&comma;v&comma;order=3&comma;knots=0&comma;0&comma;1&comma;2&comma;3&comma;3&comma;4&comma;5&comma;6

c20v<0v22v<112+v+v12v<272+3v+v222v<36+4v2v32v<484v42v<5448v+4v52v<606v&comma;0v<0v22v<112+v+7v122v<211+8v3v22v<34010v+4v32v<4122vv422v<53323v+3v522v<606v&comma;v=1..4

(3)

plotc2&comma;xydata

See Also

CurveFitting

CurveFitting[BSpline]

plot

type/algebraic