Bézier Curves

de Casteljau Subdivision

Let \(F(u)=\sum_{i=0}^n\,B_i^{\Delta,n}(u)\,\mathbf{b}_i\) a Bézier curve over \(\Delta=[s,t]\) and \(q\in [s,t]\). Define: \begin{align} F_l\,(u)&=\sum_{i=0}^n\,B_i^{\Delta_l,n} (u)\,\mathbf{b}_0^i (q)\quad\text{Bézier curve over \(\Delta_l=[s,q]\)}\notag\\ F_r\,(u)&=\sum_{i=0}^n\,B_i^{\Delta_r,n} (u)\,\mathbf{b}_i^{n-i} (q)\quad\text{Bézier curve over \(\Delta_r=[q,t]\)}\notag \end{align} where \(\mathbf{b}_i^l(q)\) are points of the de Casteljau algorithm evaluated at \(q\). Then: \[ F(u)=\begin{cases}F_l(u),&u\in[s,q]\\F_r(u),&u\in[q,t]\end{cases} \]



The JavaScript Code