 BernsteinBasis - Maple Help

BernsteinBasis

Bernstein polynomials on an interval Calling Sequence BernsteinBasis(k, n, a, b, x) Parameters

 k - algebraic expression; the index n - algebraic expression; the degree a - algebraic expression; left end of interval b - algebraic expression; right end of interval x - algebraic expression; the argument Description

 • $\mathrm{BernsteinBasis}\left(k,n,a,b,x\right)=\left(\genfrac{}{}{0}{}{n}{k}\right)\frac{{\left(b-x\right)}^{n-k}{\left(x-a\right)}^{k}}{{\left(b-a\right)}^{n}}$ defines the $k$th Bernstein polynomial of degree $n$ which is nonnegative on the interval $\left[a,b\right]$.
 • At present, this can only be evaluated in Maple by prior use of the object-oriented representation obtained by P:=convert(p,MatrixPolynomialObject,x) and subsequent call to P:-Value(), which uses the de Casteljau algorithm to evaluate the polynomial p. Examples

 > $p≔3\mathrm{BernsteinBasis}\left(0,4,0,1,x\right)+5\mathrm{BernsteinBasis}\left(2,4,0,1,x\right)+7\mathrm{BernsteinBasis}\left(4,4,0,1,x\right)$
 ${p}{≔}{3}{}{\mathrm{BernsteinBasis}}{}\left({0}{,}{4}{,}{0}{,}{1}{,}{x}\right){+}{5}{}{\mathrm{BernsteinBasis}}{}\left({2}{,}{4}{,}{0}{,}{1}{,}{x}\right){+}{7}{}{\mathrm{BernsteinBasis}}{}\left({4}{,}{4}{,}{0}{,}{1}{,}{x}\right)$ (1)
 > $P≔\mathrm{convert}\left(p,\mathrm{MatrixPolynomialObject},x\right)$
 ${P}{≔}{\mathrm{Record}}{}\left({\mathrm{Value}}{=}{{\mathrm{Default}}}_{{\mathrm{value}}}{,}{\mathrm{Variable}}{=}{x}{,}{\mathrm{Degree}}{=}{4}{,}{\mathrm{Coefficient}}{=}{\mathrm{coe}}{,}{\mathrm{Dimension}}{=}\left[{1}{,}{1}\right]{,}{\mathrm{Basis}}{=}{\mathrm{BernsteinBasis}}{,}{\mathrm{BasisParameters}}{=}\left[{4}{,}{0}{,}{1}\right]{,}{\mathrm{IsMonic}}{=}{\mathrm{mon}}{,}{\mathrm{OutputOptions}}{=}\left[{\mathrm{shape}}{=}\left[\right]{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}{,}{\mathrm{fill}}{=}{0}{,}{\mathrm{attributes}}{=}\left[\right]\right]\right)$ (2)
 > $P:-\mathrm{Degree}\left(\right)$
 ${4}$ (3)

Note that the result returned by convert(...,MatrixPolynomialObject) represents a matrix polynomial; hence these results are 1 by 1 matrices.

 > $P:-\mathrm{Value}\left(0\right)$
 $\left[\begin{array}{c}{3}\end{array}\right]$ (4)
 > $P:-\mathrm{Value}\left(1\right)$
 $\left[\begin{array}{c}{7}\end{array}\right]$ (5)
 > $P:-\mathrm{Value}\left(0.3\right)$
 $\left[\begin{array}{c}{2.100000000}\end{array}\right]$ (6)
 > $\mathrm{factor}\left(P:-\mathrm{Value}\left(t\right)\left[1,1\right]\right)$
 ${40}{}{{t}}^{{4}}{-}{72}{}{{t}}^{{3}}{+}{48}{}{{t}}^{{2}}{-}{12}{}{t}{+}{3}$ (7)