# Curves

__Definition:__ A parametrized differentiable curve is a map $\alpha : I \rightarrow \mathbb{R}^3$ being I an open interval $I \subset \mathbb{R}$ and all its components $\alpha_i \in \mathcal{C}^{\infty}$.

__Example__: The parametrized differentiable curve given by

\begin{equation}
\alpha (t) = ( a \cos(t) + b \cos(3t), a \sin(t) - b \sin(3t), c \sin(2t))
\end{equation}

Can be represented in python as follows:


```python
import math
import tensorflow as tf
import ipywidgets as widgets
import matplotlib.pyplot as plt
```


```python
def curve(a=1, b=1, c=1):
    t = tf.linspace(-2 * math.pi, 2 * math.pi, 100)
    return (
        a * tf.math.cos(t) + b * tf.math.cos(3*t),
        a * tf.math.sin(t) - b * tf.math.sin(3*t),
        c * tf.math.sin(2*t)
    )
```


```python
@widgets.interact
def plot(a=1., b=1., c=1.):
    fig = plt.figure(figsize=(8, 6))
    ax = fig.gca(projection='3d')
    x, y, z = curve(a, b, c)
    ax.plot(x, y, z, label='parametric curve')
    ax.legend()
    plt.show()
```


```python
def plot(a=1., b=1., c=1.):
    fig = plt.figure(figsize=(10, 10))
    ax = fig.gca(projection='3d')
    
    # make the panes transparent
    ax.xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
    ax.yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
    ax.zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
    # make the grid lines transparent
    ax.xaxis._axinfo["grid"]['color'] =  (1,1,1,0)
    ax.yaxis._axinfo["grid"]['color'] =  (1,1,1,0)
    ax.zaxis._axinfo["grid"]['color'] =  (1,1,1,0)

    steps = [i/10 for i in range(20)]
    for i in steps:
        x, y, z = curve(a + i, b, c)
        ax.plot(x, y, z)
    plt.show()
```


```python
plot()
```

08e500048f124ad7c200cedd5ebc1965e2f5868c
ipynb
Jupyter Notebook
notebooks/01 - Curves.ipynb
ivanCanaveral/gradients
ff5cb63d657771537739cef531149ddd7062f1c8
MIT
2021-08-10T12:35:21.000Z
2021-08-10T12:35:21.000Z
notebooks/01 - Curves.ipynb
ivanCanaveral/differential-geometry-with-tensorflow
ff5cb63d657771537739cef531149ddd7062f1c8
MIT
notebooks/01 - Curves.ipynb
ivanCanaveral/differential-geometry-with-tensorflow
ff5cb63d657771537739cef531149ddd7062f1c8
MIT
Qwen/Qwen-72B
1. YES
2. YES