TP9 submission deadline is Thursday, 13/04/2017 at 23:59. The TP on Friday 14/04 will start at 13:30 (instead of 15:15).

# TP1 : Bézier curves, De Casteljau’s algorithm

3 February 2017 in

## Bézier curves

A degree $n$ Bézier curve takes the form

where

are the degree $n$ Bernstein polynomials, and the binomial coefficients are defined as

The Bézier points $\mathbf b_i \in \mathbb R^d$ form the control polygon.

## De Casteljau’s algorithm

• input Bézier points $\mathbf b_i$ for $i = 0, \dots, n$, and parameter $t \in [0,1]$.
• output The point $\mathbf b_0^n$ on the curve.
• compute Set $\mathbf b_i^0 = \mathbf b_i$ and compute the points

Visualisation of the steps of the De Casteljau’s algorithm, $t=0.5$.

The De Casteljau’s algorithm provides an efficient means for evaluating a Bézier curve $\mathbf{x}(t)$. It is useful to look at this algorithm in its schematic form. For a cubic curve ($n=3$):

Animation of the De Casteljau’s algorithm for a quintic curve ($n=5$).

## ToDo

1. Implement the De Casteljau algorithm and use it to evaluate the Bézier curves in the data folder. Visualise the curves together with their control polygons.
2. Try varying the sampling density. How many samples are needed to give the impression of a smooth curve?
3. Pick one dataset and visualise all intermediate polygons $\mathbf b_i^k$ from the De Casteljau algorithm for a fixed parameter, for instance $t=0.5$.
Hint: each column in the above schema represents one such polygon.