This notebook is part of https://github.com/AudioSceneDescriptionFormat/splines, see also http://splines.readthedocs.io/.

# Polynomial Parametric Curves


```python
%matplotlib inline
```


```python
import sympy as sp
sp.init_printing(order='grevlex')
```


```python
t = sp.symbols('t')
```

The coefficients are written as bold letters, because they are elements of a vector space (e.g. $\mathbb{R}^3$).


```python
coefficients = sp.Matrix(sp.symbols('abm:4')[::-1])
coefficients
```

Monomial basis functions:


```python
b_monomial = sp.Matrix([t**3, t**2, t, 1]).T
b_monomial
```


```python
b_monomial.dot(coefficients)
```

This is a cubic polynomial in its canonical form (monomial basis).

Monomial basis functions:


```python
sp.plot(*b_monomial, (t, 0, 1));
```

It doesn't look like much, but every conceivable cubic polynomial can be formulated as exactly one linear combination of those basis functions.

Example:


```python
example_polynomial = (2 * t - 1)**3 + (t + 1)**2 - 6 * t + 1
example_polynomial
```


```python
sp.plot(example_polynomial, (t, 0, 1));
```

Can be re-written with monomial basis functions:


```python
example_polynomial.expand()
```


```python

```

3e43a382f91193995888395d76a10b69e54e8481
ipynb
Jupyter Notebook
doc/polynomials.ipynb
mgeier/splines
f54b09479d98bf13f00a183fd9d664b5783e3864
MIT
doc/polynomials.ipynb
mgeier/splines
f54b09479d98bf13f00a183fd9d664b5783e3864
MIT
doc/polynomials.ipynb
mgeier/splines
f54b09479d98bf13f00a183fd9d664b5783e3864
MIT
Qwen/Qwen-72B
1. YES
2. YES