An ordinary Bézier segment cannot trace a nontrivial circular arc exactly. Add one weight per control point, however, and the same interpolation construction can produce an exact circle. Other changes to the construction give a moving frame in three dimensions, a surface with two parameters, or a spline with local control.
Rational Bézier Curves
Polynomial Bézier curves are closed under affine transformations, but perspective projection is not affine. Introduce one scalar weight \(w_i\) for every control point and form the rational curve
\[ \mathbf R(t)= \frac{\sum_{i=0}^{n}w_i b_{i,n}(t)\mathbf P_i} {\sum_{i=0}^{n}w_i b_{i,n}(t)}. \]
This is not a separate interpolation trick. Lift each \(d\)-dimensional control point into homogeneous \((d+1)\)-space,
\[ \widehat{\mathbf P}_i=(w_i\mathbf P_i,w_i). \]
Ordinary de Casteljau interpolation of the lifted controls gives \(\widehat{\mathbf R}(t)=(\mathbf X(t),W(t))\). Projecting back by \(\mathbf R(t)=\mathbf X(t)/W(t)\) produces the quotient above. Consequently, the same stable triangular construction works for every degree and any number of spatial coordinates; division happens only once, after the final interpolation. A zero \(W(t)\) is a projective point at infinity and cannot be returned as a finite Euclidean point.
Multiplying every weight by the same nonzero constant leaves the curve unchanged. Equal weights recover the polynomial Bézier curve. Positive weights preserve endpoint interpolation and the convex-hull property because the normalized coefficients \(w_i b_{i,n}(t)/\sum_j w_j b_{j,n}(t)\) remain nonnegative and sum to one. Increasing one positive weight pulls the curve toward its control point. Zero or negative weights are meaningful in projective constructions, but they can remove the convex-hull guarantee or make the denominator vanish.
An Exact Quarter Circle
A nonconstant polynomial parameterization cannot satisfy \(x(t)^2+y(t)^2=1\) identically, but a rational quadratic can. Choose
\[ \mathbf P_0=(1,0),\qquad \mathbf P_1=(1,1),\qquad \mathbf P_2=(0,1), \qquad (w_0,w_1,w_2)=\left(1,\frac{\sqrt 2}{2},1\right). \]
The endpoint derivatives follow the coordinate axes, and symmetry places the midpoint on \(x=y\). Requiring that midpoint to equal \((1/\sqrt 2,1/\sqrt 2)\) determines \(w_1=\sqrt 2/2\). With \(u=1-t\), its homogeneous coordinates are
\[ X=u^2+\sqrt 2ut,\qquad Y=\sqrt 2ut+t^2,\qquad W=u^2+\sqrt 2ut+t^2. \]
Direct expansion gives \(X^2+Y^2=W^2\), hence the projected coordinates satisfy \(x(t)^2+y(t)^2=1\) for every \(t\), not merely at sampled parameters. More generally, for a circular sweep \(|\theta|<\pi\), use the arc endpoints as the outer controls, their tangent-line intersection as the middle control, and \(w_1=\cos(\theta/2)\) with endpoint weights one. Split semicircles and longer sweeps into smaller segments to avoid a zero or negative middle weight.
Normals in Three Dimensions
In the plane, rotating a tangent by 90 degrees chooses a normal. In 3D, every vector in a whole plane is perpendicular to the tangent, so extra structure is required. For a regular spatial curve, curvature is
\[ \kappa(t)=\frac{\|\mathbf B'(t)\times\mathbf B''(t)\|}{\|\mathbf B'(t)\|^3}. \]
Where the cross product is nonzero, exact polynomial derivatives give the Frenet frame without sampling a nearby parameter:
\[ \mathbf T=\frac{\mathbf B'}{\|\mathbf B'\|},\qquad \mathbf B_f=\frac{\mathbf B'\times\mathbf B''}{\|\mathbf B'\times\mathbf B''\|},\qquad \mathbf N=\mathbf B_f\times\mathbf T. \]
The frame becomes undefined where curvature vanishes and may flip near inflections. For camera rails, swept surfaces, and ribbons, a rotation-minimizing frame transported along sampled points is usually more stable and visually quieter. The library therefore reports null instead of inventing a direction at a straight point.
Tensor-Product Bézier Surfaces
A rectangular control net \(\mathbf P_{ij}\), with \(0\le i\le n\) and \(0\le j\le m\), extends the curve construction to two parameters:
\[ \mathbf S(u,v)=\sum_{i=0}^{n}\sum_{j=0}^{m} b_{i,n}(u)b_{j,m}(v)\mathbf P_{ij},\qquad (u,v)\in[0,1]^2. \]
The product weights are nonnegative and sum to one, so the entire patch remains in the convex hull of its control net. Evaluation requires no new algorithm: first run de Casteljau along every row at \(v\), then run it once more through the resulting points at \(u\). Reversing the two directions gives the same point. Fixing one parameter produces an ordinary Bézier iso-parameter curve.
Differentiating in either parameter turns neighboring control points into a derivative control net:
\[ \begin{aligned} \mathbf S_u(u,v)&=n\sum_{i=0}^{n-1}\sum_{j=0}^{m} (\mathbf P_{i+1,j}-\mathbf P_{ij})b_{i,n-1}(u)b_{j,m}(v),\\ \mathbf S_v(u,v)&=m\sum_{i=0}^{n}\sum_{j=0}^{m-1} (\mathbf P_{i,j+1}-\mathbf P_{ij})b_{i,n}(u)b_{j,m-1}(v). \end{aligned} \]
Where \(\mathbf S_u\times\mathbf S_v\) is nonzero, the unit normal is \(\mathbf N=(\mathbf S_u\times\mathbf S_v)/\|\mathbf S_u\times\mathbf S_v\|\). In the projected patch below, blue and green curves hold \(v\) and \(u\) constant respectively. The short blue and green segments are the two tangent directions; red is the surface normal.
Why B-Splines Behave More Locally
A single degree-\(n\) Bézier segment uses every control point throughout \([0,1]\), so moving one control generally changes the whole segment. B-spline basis functions instead have compact support on a knot vector; moving one de Boor control point changes only the parameter intervals covered by the corresponding basis function. They retain nonnegativity, partition of unity, convex-hull bounds, and recursive evaluation, but use the de Boor algorithm rather than de Casteljau. Piecewise Bézier segments remain preferable when explicit segment boundaries and simple interchange are the main concerns; B-splines are preferable when local editing across a longer smooth curve or surface matters.
Bernstein Approximation and the Weierstrass Theorem
Several additional identities explain why this basis is so useful. Each basis function has an order- \(i\) zero at \(t=0\), an order-\(n-i\) zero at \(t=1\), and the symmetry \(b_{i,n}(t)=b_{n-i,n}(1-t)\). Its maximum on \([0,1]\) occurs at \(t=i/n\). The first two normalized factorial moments are
\[ t=\sum_{i=0}^{n}\frac{i}{n}b_{i,n}(t),\qquad t^2=\sum_{i=0}^{n}\frac{i(i-1)}{n(n-1)}b_{i,n}(t)\quad(n\ge2). \]
Equivalently, if \(I\) is binomially distributed with parameters \(n\) and \(t\), then the Bernstein weights are its probabilities. The first identity says \(\operatorname E[I/n]=t\); the variance \(t(1-t)/n\) measures how tightly those weights concentrate around \(t\). The basis itself can be generated without powers or binomial coefficients by the Pascal-like recursion
\[ b_{i,m}(t)=(1-t)b_{i,m-1}(t)+t b_{i-1,m-1}(t), \]
with \(b_{0,0}=1\) and out-of-range indices interpreted as zero. This is the scalar counterpart of de Casteljau's construction.
For a continuous scalar function \(f:[0,1]\to\mathbb R\), sample \(f\) at the uniform nodes and use those samples as coefficients:
\[ \mathcal B_n[f](t)=\sum_{i=0}^{n}f\!\left(\frac{i}{n}\right)b_{i,n}(t). \]
The probabilistic reading gives \(\mathcal B_n[f](t)=\operatorname E[f(I/n)]\). As \(n\) grows, the variance of \(I/n\) tends uniformly to zero. Uniform continuity of \(f\) then makes the contribution near \(t\) arbitrarily accurate, while the probability of the remaining samples tends uniformly to zero. Hence \(\mathcal B_n[f]\to f\) uniformly. This constructive form of the Weierstrass approximation theorem uses the same control-point machinery as a Bézier curve: the graph is the curve with controls \((i/n,f(i/n))\), because its x-coordinate is exactly \(t\) by the first-moment identity.
References
- [deCasteljau1959]Paul de Casteljau, Outillages méthodes calcul, André Citroën internal report, 1959.
- [Bezier1972]Pierre Bézier, Numerical Control: Mathematics and Applications, John Wiley & Sons, 1972.
- [Farin2002]Gerald Farin, Curves and Surfaces for CAGD: A Practical Guide, fifth edition, Morgan Kaufmann, 2002.
- [WangEtAl2008]Wenping Wang, Bert Jüttler, Dayue Zheng, and Yang Liu, Computation of Rotation Minimizing Frames, ACM Transactions on Graphics 27(1), 2008.