|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<!-- STYLES-MARKER --> |
|
<style> |
|
/* STYLE-MARKER */ |
|
</style> |
|
<script src='https://jspm.io/system.js'></script> |
|
<script type="text/x-mathjax-config"> |
|
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); |
|
</script> |
|
<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script> |
|
<!-- SHADERS-MARKER --> |
|
<!-- SCRIPTS-MARKER --> |
|
</head> |
|
<body> |
|
<h1>Projection</h1> |
|
<h2>From Coordinates to Vectors</h2> |
|
<p> |
|
The challenge in introducing Geometric Algebra to students is that it is often treated in advanced texts from an axiomatic point of view. |
|
</p> |
|
<p> |
|
We assume that students are familiar with coordinates in the Euclidean plane or space. |
|
Our approach will be to compute invariant quantities using coordinates. |
|
We then introduce mathematical definitions as a convenient notation. |
|
</p> |
|
<h2>Vectors</h2> |
|
<p> |
|
A vector will be defined loosely and the concept will be firmed up. |
|
So a vector is defined to be a directed line segment visualized as a line with an arrowhead at one end to specify the orientation. |
|
</p> |
|
<h2>Representation of a Vector</h2> |
|
<p> |
|
We will represent a vector as a list of coordinates that when combined with a basis yield the vector. |
|
</p> |
|
$\mathbf{a} \leftrightarrow [a_x, a_y, a_z]$ in the basis $[e_x, e_y, e_z]$ |
|
means |
|
$$ |
|
\mathbf{a} = a_x e_x + a_y e_y + a_z e_z |
|
$$ |
|
<p> |
|
We make it clear that $[e_i]$ is a Euclidean ortho-normal basis, even though we don't yet have the tools to say this formally. |
|
</p> |
|
<h2>Equation of a point on a line</h2> |
|
<p> |
|
We'll need this before we try to compute the projection. |
|
</p> |
|
<h2>Computing Projection using Cartesian Coordinates</h2> |
|
<p> |
|
We need a good definition for orthogonal projection. |
|
The projection of a point onto a line can be defined as the point on the line which is closest to the other point. |
|
Students can deduce that this makes a right angle appear and so the projection is orthogonal. |
|
They should further deduce that Pythagoras's formula can be applied to solve these problems. |
|
</p> |
|
<h2>Solution</h2> |
|
<p> |
|
Let the projection point along $\hat{\mathbf{a}}$ be $P$ so that $\vec{OP} = \mu \mathbf{a}$ |
|
</p> |
|
$$ |
|
OB^2 = OP^2 + BP^2 |
|
$$ |
|
<p> |
|
We go to coordinates with this statement to find $\mu$. |
|
</p> |
|
$$ |
|
b_x^2 + b_y^2 = (\mu a_x)^2 + (\mu a_y)^2 + (b_x - \mu a_x)^2 + (b_y - \mu a_y)^2 |
|
$$ |
|
<p> |
|
A lot of cancellation happens to reveal $\mu$ |
|
</p> |
|
$$ |
|
\mu = \frac{a_x b_x + a_y b_y}{a_x^2 + a_y^2} |
|
$$ |
|
<p> |
|
$\vec{OP}$ is the quantity that we want and we give it a special name, $proj(b,a)$ |
|
</p> |
|
$$ |
|
proj(\mathbf{b}, \mathbf{a}) = \frac{a_x b_x + a_y b_y}{a_x^2 + a_y^2} \mathbf{a} |
|
$$ |
|
<p> |
|
We can convert the RHS to a non-coordinate notation by introducing the <b>dot product</b> of two vectors. |
|
</p> |
|
$$ |
|
\mathbf{a} \cdot \mathbf{b} = a_x b_x + a_y b_y |
|
$$ |
|
$$ |
|
proj(\mathbf{b}, \mathbf{a}) = \frac{\mathbf{a} \cdot \mathbf{b}}{\left| \mathbf{a} \right|} \hat{\mathbf{a}} |
|
$$ |
|
<p> |
|
Students can now implement the various aspects of this formula (direction, magnitude, dot and proj). |
|
</p> |
|
<h2>Scalars</h2> |
|
<p> |
|
We haven't got to rotations yet so we can only give a loose definition of scalars. |
|
A scalar is a number whose value doesn't change when we rotate the coordinate axes. |
|
It also doesn't change sign when we reflect in a mirror. |
|
A student should be able to convince herself that the magnitude of a vector is a scalar. |
|
A student should also be able to convince herself that $\mathbf{a} \cdot \mathbf{b}$ is a scalar-valued function. |
|
The important point is that scalars aren't just numbers. |
|
</p> |
|
<h2>Avoiding circular definitions</h2> |
|
<p> |
|
A pedagogical issue is that the standard definition of the projection function is vector-valued. |
|
This creates a circular definition when trying to define the scalar product because |
|
$$ |
|
\mathbf{a} \cdot \mathbf{b} = proj(\mathbf{a}, \mathbf{b}) \mathbf{b} = proj(\mathbf{b}, \mathbf{a}) \mathbf{a} |
|
$$ |
|
</p> |
|
<p> |
|
Suppose we define a scalar-valued function, $\pi$, representing the magnitude of the projection |
|
$$ |
|
proj(b,a) = \pi(b, a) \hat{a} |
|
$$ |
|
|
|
And so now, |
|
$$ |
|
a \cdot b = \pi(a,b) \left| a \right| |
|
$$ |
|
Using the definition of projection as defining the nearest point on a line to a point |
|
off the line, students can now implement $\pi$ using the pythagoras formula. |
|
Also implement $magnitude$, and <code>__vbar__</code> to |
|
give an operator for the scalar product of two vectors. |
|
</p> |
|
|
|
<p> |
|
Students should be able to show mathematically |
|
using coordinates that $a \cdot b = b \cdot a$, and should be able to provide geometric arguments based |
|
upon the properties of the $proj$ function that this symmetry makes sense. |
|
</p> |
|
<p> |
|
If $magnitude$ has already been implemented in programming with an orthogonal basis, |
|
and if multiplication of parallel vectors has been introduced, then students could be introduced |
|
to the following idea: |
|
$$ |
|
proj(a, b)b = proj(b, a)a = \frac{1}{2} (ab + ba) |
|
$$ |
|
</p> |
|
<p> |
|
While this definition of symmetric multiplication does not allow us to implement general vector multiplication, |
|
$ab$, it takes us a bit closer. Suppose we have |
|
$$ |
|
foo(a, b) = \frac{1}{2}(ab - ba), |
|
$$ |
|
</p> |
|
where foo is an already implemented function, then |
|
$$ |
|
\begin{eqnarray} |
|
ab & = & \frac{1}{2} (ab + ba) + \frac{1}{2} (ab - ba) \\ |
|
& = & proj(a,b)b + foo(a, b) |
|
\end{eqnarray} |
|
$$ |
|
<script> |
|
// CODE-MARKER |
|
</script> |
|
<script> |
|
System.import('./projection.js') |
|
</script> |
|
</body> |
|
</html> |