Representation of Polynomial Curves

This script compares the representation of polynomials curves given by the same set of control points but for different basis. In this particular case we compare three polynomial curves generated using the control points \(\{A, B, C, D\}\) and the monomial, Lagrange and Bernstein polynomials for the basis of the polynomial space of degree \(n=3\): \[ \begin{align} F(u)&=\sum_i\,\mathbf{a}_i\,u^i \\ G(u)&=\sum_i\,\mathbf{p}_i\,L_i^n(u) \\ H(u)&=\sum_i\mathbf{b}_i\,B_i^n(u) \end{align} \] where in this particular case we have chosen \(a_0 = p_0 = b_0 = A, a_1 = p_1 = b_1 = B, a_2 = p_2 = b_2 = C, a_3 = p_3 = b_3 = D\), and \(\{u^i\}_{i=0}^n\) is the monomial, \(\{L(u)^i\}_{i=0}^n\) the Lagrange, and \(\{B^n_i(u)\}_{i=0}^n\) the Bernstein basis. Select and drag the control points in order to see how the curves behave.


The JavaScript Code for Neville's Algorithm to evaluate the Lagrange Polynomial

The JavaScript Code for Horner's Scheme to evaluate the Polynomials in the monomial basis