**Appendix A**

In this section we present and examine relevant properties of Bernstein polynomials and rational Bernstein polynomials, which are used throughout the article.

#### **Property A1.** *Convex Hull*

*Both the Bernstein polynomial, Equation* (5)*, and the rational Bernstein polynomial* (6) *(provided that wi*,*<sup>n</sup>* > 0, *i* = 0, . . . , *n) satisfy*

$$\min\_{k \in \{0, \dots, n\}} P\_k \le \mathcal{C}\_n(t) \le \max\_{k \in \{0, \dots, n\}} P\_{k'} \,\forall t \in [t\_{0 \prime} t\_f]. \tag{A1}$$

*It follows that 2D (or 3D) Bernstein polynomials and rational Bernstein polynomials lie within the convex hull defined by their Bernstein coefficients. An example of this property is depicted in Figure A1, which shows a 2D Bernstein polynomial contained within its convex hull.*

**Figure A1.** Convex hull of a Bernstein polynomial where the solid blue line is the curve, the black dotted line is the convex hull, and the orange points connected by dashed lines are the Bernstein coefficients.

### **Property A2.** *End Point Values*

*The first and last Bernstein coefficients of the Bernstein polynomial introduced in Equation* (5)*, as well as the rational Bernstein polynomial in Equation* (6)*, are their endpoints, i.e.,*

$$\mathbb{C}\_n(t\_0) = P\_0 \quad \text{and} \quad \mathbb{C}\_n(t\_f) = P\_n.$$

*Furthermore, the tangents to the curve at its first and last coefficients are the same as the lines connecting the first and second coefficients and the penultimate and ultimate coefficients, respectively. It follows that the first derivative of the Bernstein polynomial at the end points is as follows*

$$\begin{split} \dot{\mathsf{C}}\_{n}(t\_{0}) &= \frac{n}{t\_{f} - t\_{0}} (P\_{1,n} - P\_{0,n}), \\ \mathsf{C}\_{n}(t\_{f}) &= \frac{n}{t\_{f} - t\_{0}} (P\_{n,n} - P\_{n-1,n}). \end{split} \tag{A2}$$

*Similarly, for a rational Bernstein polynomial we have*

$$\begin{split} \dot{\mathsf{C}}\_{n}(t\_{0}) &= \frac{nw\_{1}}{(t\_{f} - t\_{0})w\_{0}} (P\_{1,n} - P\_{0,n}), \\ \dot{\mathsf{C}}\_{n}(t\_{f}) &= \frac{nw\_{n-1}}{(t\_{f} - t\_{0})w\_{n}} (P\_{n,n} - P\_{n-1,n}). \end{split} \tag{A3}$$

#### **Property A3.** *Derivatives*

*The derivative of the Bernstein polynomial introduced in Equation* (5) *is an* (*n* − 1)*th order Bernstein polynomial given by*

$$\mathcal{C}\_{n-1}(t) = \sum\_{i=0}^{n-1} P'\_{i,n-1} B\_{i,n-1}(t),\tag{A4}$$

*with the vector of Bernstein coefficients P <sup>n</sup>*−<sup>1</sup> = [*<sup>P</sup>* 0,*n*−1,..., *<sup>P</sup> <sup>n</sup>*−1,*n*−1] *given by*

$$P\_{n-1}' = P\_n \mathbf{D}\_{n-1}$$

*In the equation above,* **D***n denotes the differentiation matrix given by*

$$\mathbf{D}\_{n} = \frac{n}{t\_{f} - t\_{0}} \begin{bmatrix} -1 & 0 & \cdots & 0 \\ 1 & \ddots & \ddots & \vdots \\ 0 & \ddots & \ddots & 0 \\ \vdots & \ddots & \ddots & -1 \\ 0 & \cdots & 0 & 1 \end{bmatrix} \in \mathbb{R}^{n+1 \times n}. \tag{A5}$$

**Remark A1.** *Properties A2 and A3 can be easily extended to compute higher order derivatives of Bernstein polynomials.*

#### **Property A4.** *Integrals*

*The definite integral of a Bernstein polynomial is given by*

$$\int\_{t\_0}^{t\_f} \mathbb{C}\_n(t)dt = \frac{t\_f - t\_0}{n+1} \sum\_{i=0}^n P\_{i,n} \,. \tag{A6}$$

#### **Property A5.** *The de Casteljau Algorithm*

*The de Casteljau algorithm computes a Bernstein polynomial defined over an interval* [*t*0, *tf* ] *at any given tdiv* ∈ [*t*0, *tf* ]*. Moreover, it can be used to split a single Bernstein polynomial into two independent Bernstein polynomials. Given the Bernstein polynomial introduced in Equation* (5) *with the vector of coefficients Pn* = [*P*0,*<sup>n</sup>* , ... , *Pn*,*n*]*, and a scalar tdiv* ∈ [*t*0, *tf* ]*, the Bernstein polynomial at tdiv is computed using the following recursive relationship:*

$$P\_{i,n}^{0} = P\_{i,n}, \quad i = 0, \ldots, n,$$

$$P\_{i,n}^{j} = \frac{t\_f - t\_{div}}{t\_f - t\_0} P\_{i,n}^{j-1} + \frac{t\_{div} - t\_0}{t\_f - t\_0} P\_{i+1,n}^{j-1}$$

*with i* = 0, ... , *n* − *j* , *and j* = 1, ... , *n. Then, the Bernstein polynomial evaluated at tdiv is Cn*(*tdiv*) = *P<sup>n</sup>* 0,*<sup>n</sup>* . *Note that the superscript here signifies an index and not an exponent. Moreover, the Bernstein polynomial can be subdivided at tdiv into two nth order Bernstein polynomials with coefficients*

$$P^{0}\_{0,n'}P^{1}\_{0,n'} \dots \Box P^{1}\_{0,n} \quad \text{and} \quad P^{n}\_{0,n'}P^{n-1}\_{1,n} \dots \Box P^{0}\_{n,n} \dots$$

*A geometric example of a* 3*rd order Bernstein polynomial being split at tdiv* = 0.5 *using the de Casteljau is shown in Figure A2. Note that at the final iteration only a single point remains,* **P**<sup>3</sup> 0,*n, and lies on the original curve. The points* {**P**<sup>0</sup> 0,*n*, **<sup>P</sup>**<sup>1</sup> 0,*n*, **<sup>P</sup>**<sup>2</sup> 0,*n*, **<sup>P</sup>**<sup>3</sup> 0,*n*} *become the Bernstein coefficients of the left curve and the points* {**P**<sup>3</sup> 0,*n*, **<sup>P</sup>**<sup>2</sup> 1,*n*, **<sup>P</sup>**<sup>1</sup> 2,*n*, **<sup>P</sup>**<sup>0</sup> 3,*n*} *become the coefficients of the right curve.*

**Figure A2.** Geometric example of the de Casteljau algorithm splitting a 2D Bernstein polynomial at *tdiv* <sup>=</sup> 0.5. The original curve is defined by the Bernstein coefficients {**P**<sup>0</sup> 0,*n*, ... , **<sup>P</sup>**<sup>0</sup> 3,*n*}, the left hand curve is shown in red, the right hand curve is shown in blue, and the superscript corresponds to the current iteration of the algorithm.

**Remark A2.** *For high order Bernstein polynomials, the exponential terms in Equation* (5) *can cause overflows. The de Casteljau algorithm can be used to overcome these issues on a computer when computing the value of a Bernstein polynomial, especially if lower bit floating point values are to be used such as 16 or 32 bits.*

#### **Property A6.** *Degree Elevation*

*The degree of a Bernstein polynomial can be elevated by one using the following recursive relationship*

$$P\_{i,n+1} = \frac{i}{n+1} P\_{i-1,n} + \left(1 - \frac{i}{n+1}\right) P\_{i,n'}$$

*where P*0,*n*+<sup>1</sup> = *P*0,*<sup>n</sup> and Pn*+1,*n*+<sup>1</sup> = *Pn*,*n. Furthermore, any Bernstein polynomial of degree n can be expressed as a Bernstein polynomial of degree m, m* > *n. The vector of coefficients of the degree elevated Bernstein polynomial, namely* **P***<sup>m</sup>* = [*P*0,*m*,..., *Pm*,*m*]*, can be calculated as*

$$\mathbf{P}\_{\mathrm{m}} = \mathbf{P}\_{\mathrm{m}} \mathbf{E}\_{\mathrm{m}}$$

*where* **<sup>E</sup>** <sup>=</sup> {*ej*,*k*} ∈ <sup>R</sup>(*n*+1)×(*m*+1) *is the degree elevation matrix with elements given by*

$$x\_{i,i+j} = \frac{\binom{m-n}{j}\binom{n}{i}}{\binom{m}{i+j}}\,\,\,\,\,\tag{A7}$$

*where i* = 0, ... , *n and j* = 0, ... , *m* − *n, all other values in the matrix are zero, and* **P***<sup>n</sup>* = [*P*0,*n*, ... , *Pn*,*n*] *is the vector of Bernstein coefficients of the curve being elevated (see [52]). Because* **E** *is conveniently independent of the coefficients, it can be computed ahead of time and stored for efficient computation of degree elevated Bernstein polynomials. By degree elevating a Bernstein polynomial, the coefficients converge to the polynomial, i.e.*

$$\max\_{i} \left| P\_{i,m} - \mathbb{C}\_{m} \left( \frac{i}{m} (t\_f - t\_0) + t\_0 \right) \right| \le \frac{k}{m'} \tag{A8}$$

*where k is a positive constant independent of m (see [53]).*
