# Definitions
> [!Definition] Definition (Parametrized Curve)
> Let $\underline{r}:I \to \mathbb{R}^{n}$ be [[Vector-Valued Function of Real variable|vector-valued function of a single real variable]] , where $I \subseteq \mathbb{R}$ is an [[Real intervals]]. Then [[Image of a set under a function|image]] of the interval $I$ under $\underline{r}$ $C = \{ \underline{r}(t) \mid t \in I \}$is called a ***parametrized curve*** in $\mathbb{R}^{n}$.
>
> The function $\underline{r}$ is called a ***parametrisation*** of the curve $C$. $t$ is called the *parameter*.
>
**Variations**: Some sources define the parametrized curve to be mapping $\underline{r}(t)$ itself and the image of $\underline{r}(t)$ to be its **trace**.
# Properties
- The set of points $\mathcal{C}$ is said to be regular if it has a [[Regular Parametrization|regular parametrization]].
- A curve usually comes with a direction in which the curve is traced out (e.g. “start from A and end at B”, or “traversed in an anti-clockwise direction”). We say the curve has an **orientation**. We can also say it is an **oriented** curve.
- A curve that does not intersect itself is said to be a **simple** or **embedded** curve.
- A curve parametrised by $\underline{r}(t), \;t\in[a,b]$ is said to be **closed** if $\underline{r}(a)=\underline{r}(b)$.
- A parametric curve is [[Regular Parametrization|regular]] if it has a parametrisation whose derivative (known as its speed) is non-zero.
- If each component function of $\underline{r}(t)$ can be differentiated infinitely many times is a [[Continuous Differentiability|smooth]], we say that the curve parametrised by $\underline{r}(t)$ is **smooth**.
- A curve is called [[Algebraic Curve|algebraic]] if the zero set of a [[Polynomial|polynomial]].
# Examples
> [!Example] Example 1
> A line in $\mathbb{R}^{3}$ can be parametrised by $\underline{r}(t)=\underline{a}t+\underline{b}$ where $\underline{a} \neq \underline{0}$ and $\underline{b}$ are constant vectors in $\mathbb{R}^{3}$ and $t \in \mathbb{R}$.
> The vector $\underline{a}$ is called the *direction vector* as it determines the direction of the line.
> [!Example] Example 2 (Line joining two points)
> Let $\underline{a}$ and $\underline{b}$ be the position vectors of points $A$ and $B$.
> Write down a parametrisation of the line, beginning at $A$ and ending at $B$, using the following parameters: (1) $t \in [0,1]$ (2) $u \in [0,2\pi]$ (3) $v \in [-1,1]$.
>
> **Solution**
> 1. Direction vector of line: $\underline{b}-\underline{a}$
> $\underline{r}(t)=(\underline{b}-\underline{a})t +\underline{a}$
> Check $\underline{r}(0)=\underline{a},\; \underline{r}(1)=\underline{b}$.
> 2. $0\leq t \leq 1 \iff 0\leq 2\pi t\leq 2\pi$
> Let $u = 2\pi t \implies t=\frac{u}{2\pi}$
> Parametrisation is given by $\underline{r}(u)=(\underline{b}-\underline{a}) \frac{u}{2 \pi} + \underline{a}$ for $u \in [0,2\pi]$.
> Check $\underline{r}(0)=\underline{a}$, $\underline{r}(2\pi)=\underline{b}$.
> 1. $0 \leq t\leq 1\iff -1\leq2t-1\leq 1$
> Let $v=2t-1\implies t=\frac{v+1}{2}$
> Parametrisation is given by $\underline{r}(v)=(\underline{b}-\underline{a}) \frac{v+1}{2}+\underline{a}$, $v\in [-1,1]$.
> Check $\underline{r}(-1)=\underline{a}$, $\underline{r}(1)=\underline{b}$.
>
> This example demonstrates that parametrisations are not unique.
> [!Example] Example 3 (Parabolas)
> 1. Write down a parametrisation of the curve $y=ax^{2}+bx+c$.
> 2. Consider the curve parametrised by $\underline{r}(t)=(2t^{2},t)$ where $t \in [-2,2]$. Find its Cartesian equation and sketch the curve. Include an arrow to indicate increasing $t$.
> 3. Sketch the curve parametrised by $\underline{r}(t)=(2\sin^{2}t,\sin t)$ where $t \in[0,2\pi]$.
>
> **Solution**
> 1. $\underline{r}(t)=(t,at^{2}+bt+c)$, $t \in \mathbb{R}$.
> 2. $x=2t^{2},y=t \implies x=2y^{2}$, $y\in[-2,2]$.
> 3. $x=2\sin^{2}t,y=\sin t\implies x=2y^{2}$.
> [!Example] Example 4 (Curve defined piecewise)
> The curve shown below 'starts' at $A$ and ends at $B$. Write down a parametrisation of the curve using *parameter* $t\in[-1,1]$.
>
> ![[Curve defined piecewise.png|200]]
>
> **Solution**
> $\underline{r}(t) = \begin{cases} \underline{r}_{1}(t) & -1 \leq t \leq 0 \\ \underline{r}_{2}(t) & 0 \leq t \leq 1 \end{cases}$where $\begin{align}\underline{r}_{1}(t) &= (-t,t^{2}) \\ \underline{r}_{2}(t) &= \left( t,-\frac{1}{2} t \right) \end{align}$
> [!Example] Example 5 (Circle)
> Write down two parameterisations of the semi-circle $x^{2}+y^{2}=2$ and $y\geq 0$, traversed in the anti-clockwise direction.
>
> **Solution**
> $y = \sqrt{ 2-x^{2} }$.
> First parametrisation: $\underline{r}(t)=(-t,\sqrt{ 2-t^{2} })$, $t\in[-\sqrt{ 2 }, \sqrt{ 2 }]$.
>
> ![[semi-circle.png|200]]
>
> Second parametrisation: $\underline{r}(t)=(\sqrt{ 2 } \cos t, \sqrt{ 2 } \sin t)$, $t \in [0,\pi]$.
> [!Example] Example 6 (Ellipse)
> 1. Find the Cartesian equation of the curve parameterised by $\underline{r}(t)=(3\cos t,2\sin t)$, where $t \in [0,2\pi]$. Sketch the curve.
> 2. Sketch the curve parametrised by $\underline{r}(t)=(3\sin t-3,2\cos t+2)$ where $t \in [0, \pi]$
>
> **Solution**
> 1. $\left( \frac{x}{3} \right)^{2}+\left( \frac{y}{2} \right)^{2}=\sin^{2}t+\cos^{2}t=1$ .
>
> ![[ellipse (parametric).png|200]]
>
> 2. Translation of the curve above by $(-3,2)^{T}$.
> [!Example] Example (Hyperbola)
> 1. Find the Cartesian equation of the curve parametrised by $\underline{r}(t)=(2\sinh t, \cosh t)$, where $t \in \mathbb{R}$. Sketch the curve.
> 2. Find the parametrisation for the curve $x^{2}-4y^{2}=1$, where $x>0$. Sketch the curve.
>
> **Solution**
> 1. $y^{2}-\left( \frac{x}{2} \right)^{2} = \cosh^{2}t-\sinh^{2}t=1$, where $y > 0$.
> 2. $\underline{r}(t)=\left( \cosh t, \frac{1}{2} \sinh t \right)$, $t\in \mathbb{R}$.
> [!Example] Example (Helix)
> Sketch the curves in $\mathbb{R}^{3}$ parametrised by $\underline{r}(t)=(\cos t, \sin t, t), \quad t\in [0,2\pi].$
> ![[parametrised helix.png|300]]
# Plotting Curves on a Computer
We use [[matplotlib.pyplot]].
### Example: Circle
```run-python
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 2*np.pi, 100) # Added the number of points (e.g., 100) for a smoother curve
# 2D Plot
plt.plot(np.cos(t), np.sin(t))
plt.title('2D Plot')
plt.show()
# 3D Plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot(np.cos(t), np.sin(t), t)
ax.set_title('3D Plot')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
plt.show()
```
### Example: Helix
### Example: Polar Coordinates