# Investigating 3D geometric algebra

Geometric algebra has been around since the work of William Clifford in the 19th Century but was relatively unknown until a resurgence in the 1980's through the work of David Hestenes. Since then, Geometric algebra has become a popular way of describing many problems in physics and other areas.
Unfortunately Geometric algebra is often introduced using many terms and symbols that are foreign to most people, the result being that it remains inaccessible to many without a sufficient background in Mathematics. The primary goal of this learning project is to introduce Geometric Algebra in an accessible and fun way for people with a high school background in Math and Physics.

## Project Summary
### Project Goals

This learning project aims to:
* introduce you to Geometric Algebra within our familiar three-dimensional space.

### Target participants

This learning project is targetted at people with an interest in maths or Physics. If you're interested in either topic, then you might enjoy learning, participating, contributing, editing, simplifying or just helping me understand my mistakes.

### Assumed background knowledge/skills

You can start learning Geometric Algebra with a high school level of algebra and geometry. For this learning project, if you can answer the following without too much effort (and without a calculator!), then you should be fine:
* What is the value of $x$ if ${\frac {x^{2}}{3}}=12$?
* Expand $(x+3y)(2x+y)$.
* What shape is created by tracing out the points p1=(2,0,0), p2=(2,1,0), p3=(0,1,0), p4=(0,0,0)?
* What is the distance between the points p1=(1,1) and p2=(0,-1)?
* What is the value of $\cos {(60^{\circ })}$ (Hint: You'll need to draw an equilateral triangle with sides of length 2 and remember SOH-CAH-TOA)?
* What is the value of $\sin {\frac {\pi }{2}}$?
* Is $\cos {(100^{\circ })}$ positive or negative (All Stations To Central or All Students Take Calculus)
If you find any of the above difficult then you may want to revise some of your algebra or geometry, otherwise you are ready to start! The following skills, although not essential, will be very helpful for understanding Geometric Algebra:
* A good mental model of 3 dimensional vectors: if you can visualise the dot and cross product of two vectors it will help you visualise Geometric Algebra. (TODO: reword into a skill)

## An introduction to Geometric Algebra
### Two dimensional coordinates: Starting with the familiar

Two dimensional cartesian coordinate's are usually familiar to those of us with a high school Mathematics background. Typical uses of Cartesian Coordinates in high school is to plot parabolas such as $f(x)=x^{2}$ and visualising where they intersect the x and y-axis, or simply to draw two dimensional geometric shapes such as triangles or parallelograms.
* Activity: Two dimensional Cartesian coordinates
* On separate, plot the points $p1=(1,0),p2=(2,1)$
* Calculate the distance of each point to origin.
* Calculate the distance between p1 and p2.
* Calculate the angle that the the line through p2 and the origin makes with the x-axis.

### Three dimensional coordinates

A three dimensional cartesian coordinate system can be created quite easily by simply adding an extra z-axis that is perpindicular to the x and y-axis and pointing out of the page. (add ref about Right-hand-rule).
Any point in a 3D space can then be represented using the coordingates along the x, y, and z axis respectively as:
$a=(a_{x},a_{y},a_{z})$.
Using an extension of Pythagoras' theorem (called the Euclidean distance), the square of the distance between the point $a$ and the origin is:
$|a|^{2}=a_{x}^{2}+a_{y}^{2}+a_{z}^{2}$

#### Challenges

* What is the distance between the point $p=(1,2,2)$ and the origin?
* What is the distance between the points $p=(1,2,2)$ and $q=(1,-1,-2)$?
* Define the points to describe a cube centred on the origin, with a side-length of 2 units.

### A three dimensional vector space

The geometry of three-dimensional space can be represented similarly using three basis vectors $\mathbf {x} ,\mathbf {y}$ and $\mathbf {z}$, one along each of the $x,y$ and $z$-axis, where each basis vector has a length of 1 unit.
Any three-dimensional vector can then be represented as a combination of these basis vectors,
$\mathbf {a} =a_{x}\mathbf {x} +a_{y}\mathbf {y} +a_{z}\mathbf {z}$
as shown in Figure 2.
Traditionally, there are two ways that you can multiply vectors: the dot product, and the cross product. It will be helpful at a later point to visualise the dot and cross product as they reveal themselves in Geometric Algebra (maybe a separate Learning Project: Visualizing vector products?), but for the moment it is enough to note that in Euclidean space, where our basis vectors are all perpendicular to each other (orthogonal) and of length 1 (normal), there is a strong relationship between the dot product and the length of a vector. For a vector a,
    $\mathbf {a} \cdot \mathbf {a} =a_{x}^{2}+a_{y}^{2}+a_{z}^{2}$
which is equivalent to the definition of $|\mathbf {a} |^{2}$ for Cartesian coordinates above.
Activities: Define 3 vectors, calculate various dot products, answer lengths. Include x.x and x.y.

### Multiplying two vectors

The multiplication of two such vectors can then be written as
$\mathbf {ab} =(a_{x}\mathbf {x} +a_{y}\mathbf {y} +a_{z}\mathbf {z} )(b_{x}\mathbf {x} +b_{y}\mathbf {y} +b_{z}\mathbf {z} )$
evaluating as
$\mathbf {ab} =a_{x}b_{x}\mathbf {x} ^{2}+a_{y}b_{y}\mathbf {y} ^{2}+a_{z}b_{z}\mathbf {z} ^{2}+a_{y}b_{z}\mathbf {y} \mathbf {z} +a_{z}b_{y}\mathbf {z} \mathbf {y} +a_{z}b_{x}\mathbf {z} \mathbf {x} +a_{x}b_{z}\mathbf {x} \mathbf {z} +a_{x}b_{y}\mathbf {x} \mathbf {y} +a_{y}b_{x}\mathbf {y} \mathbf {x}$ but to go any further, we need to define the geometric product for our basis vectors to evaluate xx and xy etc.

### The Geometric Product

If we define the length-squared of a vector to be equal to the vector squared:
    $\mathbf {a} ^{2}=|\mathbf {a} |^{2}=a_{x}^{2}+a_{y}^{2}+a_{z}^{2}$
(TODO: Make the following an activity) then calculating $\mathbf {a} ^{2}$, $\mathbf {a} ^{2}=a_{x}^{2}\mathbf {x} ^{2}+a_{y}^{2}\mathbf {y} ^{2}+a_{z}^{2}\mathbf {z} ^{2}+a_{y}a_{z}\mathbf {y} \mathbf {z} +a_{z}a_{y}\mathbf {z} \mathbf {y} +a_{z}a_{x}\mathbf {z} \mathbf {x} +a_{x}a_{z}\mathbf {x} \mathbf {z} +a_{x}a_{y}\mathbf {x} \mathbf {y} +a_{y}a_{x}\mathbf {y} \mathbf {x}$
For our definition of length to hold,
    $\mathbf {x} ^{2}=\mathbf {y} ^{2}=\mathbf {z} ^{2}=1$
which, according to our definition simply means that our basis vectors are of unit length (normal), and
    $\mathbf {x} \mathbf {y} =-\mathbf {y} \mathbf {x}$,
    $\mathbf {y} \mathbf {z} =-\mathbf {z} \mathbf {y}$,
    $\mathbf {z} \mathbf {x} =-\mathbf {x} \mathbf {z}$,
which implies that our basis vectors are all at right-angles to one another (orthogonal). Get to:
    $\mathbf {a} \mathbf {b} =\mathbf {a} \cdot \mathbf {b} +(\mathbf {a} \times \mathbf {b} )\mathbf {x} \mathbf {y} \mathbf {z}$

## Rotating vectors in 3D space

Someone who know's their "sh*t" SEND HELP !!!
Let's remove Quaternions from every 3D Engine (An Interactive Introduction to Rotors from Geometric Algebra) by Marc ten Bosch
Geometric Algebra for Physicists by Chris Doran and Anthony Lasenby