# Coordinates

## Cartesian Coordinates

The cartesian 3d coordinate system

There are several common ways to express a location:

\begin{align} \mathbf{a} & = a_x \hat{\bf{x}} + a_y \hat{\bf{y}} + a_z \hat{\bf{z}}\\ & = a_x \hat{\bf{i}} + a_y \hat{\bf{j}} + a_z \hat{\bf{k}}\\ & = (a_x,a_y,a_z) \\ & = a_1 \mathbf{e}_1 + a_2 \mathbf{e}_2 + a_3 \mathbf{e}_3 \\ & = \sum_{i=1}^3 a_i \bf{e}_i \\ & = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} \end{align}

## Vector Math

#### Magnitudes

$a^2 + b^2 = c^2$

$$\mathbf{a} = a_1 \hat{\bf{x}} + a_2 \hat{\bf{y}} +a_3 \hat{\bf{z}}$$ And $$\mathbf{b} = b_1 \hat{\bf{x}} + b_2 \hat{\bf{y}} +b_3 \hat{\bf{z}}$$ then, $$\mathbf{a} + \mathbf{b} = (a_1+b_1) \hat{\bf{x}} + (a_2+b_2) \hat{\bf{y}} + (a_3+b_3) \hat{\bf{z}}$$ and $$\mathbf{a} - \mathbf{b} = (a_1-b_1) \hat{\bf{x}} + (a_2-b_2) \hat{\bf{y}} + (a_3-b_3) \hat{\bf{z}}$$

#### Dot Product

There are two ways of multiplying vectors:

1. The dot product (or scalar product)

$\mathbf{a} \cdot \mathbf{b} = a b \cos \theta$

$\mathbf{a} \cdot \mathbf{b} = (a_1 \hat{\mathbf{x}}+a_2 \hat{\mathbf{y}}+a_3 \hat{\mathbf{z}})\cdot(b_1 \hat{\mathbf{x}}+b_2 \hat{\mathbf{y}}+b_3 \hat{\mathbf{z}})$

$\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3$

#### Dot Product - Linear Algebra

$$\begin{bmatrix} a_1 \; a_2 \; a_3 \end{bmatrix} \cdot \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix} = a_1 b_1 + a_2 b_2 + a_3 b_3$$

#### Cross Product

Defined as: $$\mathbf {a} \times \mathbf {b} =|\mathbf {a} | \; |\mathbf {b}|\; \sin(\theta )\ \mathbf {n}$$ where $\theta$ is the angle between $\mathbf {a}$ and $\mathbf {b}$, and $\mathbf {n}$ is the unit vector perpendicular to the plane containing $\mathbf {a}$ and $\mathbf {b}$

This produces a third vector that points perpendicular to both the original vectors.

$\mathbf{a} \times \mathbf{b} = (a_x \hat{\mathbf{x}}+a_y \hat{\mathbf{y}}+a_z \hat{\mathbf{z}})\times(b_x \hat{\mathbf{x}}+b_y \hat{\mathbf{y}}+b_z \hat{\mathbf{z}})$

We can calculate the cross product by computing the determinant of this matrix: $$\mathbf{a} \times \mathbf{b} = \begin{vmatrix} \mathbf{\hat{x}} & \mathbf{\hat{y}} & \mathbf{\hat{z}} \\ a_x & a_y & a_z \\ b_x & b_y &b_z \\ \end{vmatrix}$$

$$\mathbf{a} \times \mathbf{b} = (a_y b_z-a_z b_y)\hat{\mathbf{x}}+(a_z b_x-a_x b_z)\hat{\mathbf{y}}+(a_x b_y-a_y b_x)\hat{\mathbf{z}}$$

Mathematica:


a = {a1, a2, a3}
b = {b1, b2, b3}
Dot[a,b]
-> a1 b1 + a2 b2 + a3 b3
Cross[a,b]
-> {-a3 b2 + a2 b3, a3 b1 - a1 b3, -a2 b1 + a1 b2}


numpy (python)


import numpy as np

a = np.array([2,4,5])
b = np.array([1,-2,3])
c = np.dot(a,b)
print(c)
-> 9
d = np.cross(a,b)
print(d)
-> [22 -1 -8]


#### Quadratic Drag in two dimensions

In cartesian coordinates: \begin{align} m \ddot{\mathbf{r}} & = m \mathbf{g} - c v^2 \; \hat{\bf{v}} \\ & = m \mathbf{g} - c v \; \mathbf{v} \end{align}

## Other Coordinate systems

$$\begin{eqnarray} x &=& r \cos \theta \\ y &=& r \sin \theta \nonumber \\ \end{eqnarray}$$ $$\begin{eqnarray} r = \sqrt{x^2 + y^2} \\ \theta = \tan^{-1} \left(\frac{y}{x}\right) \nonumber \\ \end{eqnarray}$$

Goal: Express newton's laws in these non-cartesian coordinates: $$F = m\ddot{\mathbf{r}}$$

Unit vectors in polar coordinates

$\mathbf{\hat{r}}$ points in the direction of increasing $r$ (given a fixed $\theta$)

$\boldsymbol{\hat{\theta}}$ points in the direction of increasing $\theta$ (given a fixed $r$)

Now, the unit vectors change!

We start with $\hat{\bf{r}}$

Velocity expressed in polar coordinates: $$\dot{\mathbf{r}} = \dot{r} \hat{\bf{r}} + r \dot{\theta} \; \hat{\boldsymbol{\theta}}$$

Now we need to get the acceleration

Acceleration in polar coordinates: $$\mathbf{a} = \left( \ddot{r} - r \dot{\theta}^2 \right)\hat{\bf{r}} + \left( r \ddot{\theta} + 2 \dot{r}\dot{\theta} \right)\hat{\boldsymbol{\theta}}$$