Bernstein matrix
,
where B = bernsteinMatrix(n,t)t is a vector, returns the length(t)-by-(n+1) Bernstein
matrix B, such that B(i,k+1)= nchoosek(n,k)*t(i)^k*(1-t(i))^(n-k).
Here, the index i runs from 1 to length(t),
and the index k runs from 0 to n.
The Bernstein matrix is also called the Bezier matrix.
Use Bernstein matrices to construct Bezier curves:
bezierCurve = bernsteinMatrix(n, t)*P
n+1 rows of the matrix P specify
the control points of the Bezier curve. For example, to construct
the second-order 3-D Bezier curve, specify the control points as:P = [p0x, p0y, p0z; p1x, p1y, p1z; p2x, p2y, p2z]