Vector algebra

  • Vectors and scalars.
  • The dot product and cross product.
  • What is a vector? ...It's how it transforms.

Vectors and Scalars

4 dollars plus 3 dollars always sums to 7 dollars. Dollars are an example of a scalar quantity that possesses magnitude. Scalars add simply.

I'll write scalars as lower-case variables, e.g. cost $c$.

But if you leave your house and walk 4 miles in one direction, and then 3 miles in another direction, there is no guarantee that you are 7 miles from home. You might have simply come home by a longer way. You need more information than just the magnitude in order to add vector-ish quantities. Displacement is an example of a vector quantity that has both magnitude and direction.

I'll write vectors with an arrow over them, e.g. a displacement $\myv s$.

The magnitude of a vector is written $|\myv s| = s$.

Scalar and vector functions

A function is something like a rule or relation that returns some unique value, depending on its argument(s) (dependent variable(s)).

Temperature is an example of a scalar function in three dimensions. There is a unique temperature (a scalar quantity) at any place in the room. Temperature is a scalar function of position $(x,y,z)$, which we write as $T(x,y,z)$.

To specify the wind, or the acceleration of gravity, we'd need to associate a vector with a position relative to the earth. A rule or relation that returns a unique vector depending on its argument(s) is a vector function. We could write this as $\myv V(x,y,z)$.

 

Scalar times vector = vector.

$a\myv{V}$ is a vector with the same direction as $\myv{V}$, but with magnitude $aV$.

Dot product (scalar product)


In a form which is independent of the coordinate system used, the dot product is

$\myv{A} \cdot \myv{B} \equiv AB\cos \theta.$

You can use $\myv{C} = \myv{A} - \myv{B}$, with this definition of the dot product to remember the Law of Cosines, by calculating $\myv{C} \cdot myv{C}$...

In Cartesian coordinates

$\myv{A} \cdot \myv{B} = A_xB_x + A_yB_y + A_zB_z$.

You can combine the two forms of the dot product to solve problems such as...(Problem 1.3): What is the angle between the body diagonals of a cube...?

Cross product (vector product)

The cross product of two vectors is a vector with magnitude

$AB\sin\theta$

which is the same as the area of the trapezoid in the figure at right.

But the cross product is a vector with a direction ($\uv{n}$) which is perpendicular to both $\myv{A}$ and $\myv{B}$ according to a right-hand rule:

  1. Stretch the fingers on your right hand towards $\myv{A}$.
  2. Curl your fingers towards $\myv{B}$ (in the direction in which $\theta < 180^o$,
  3. Your thumb points in the direction of $\uv{n}$.

$\myv{A} \times \myv{B} \equiv AB\sin\theta \,\uv{n}$.

With the right hand rule, the order in which the two vectors are "crossed" matters:

$\myv{A} \times \myv{B} = - \myv{B} \times \myv{A}$.

The cross product is not generally distributive. Try coming up with a set of three vectors such that...

$(\myv{A} \times \myv{B}) \times \myv{C} \neq \myv{A} \times (\myv{B} \times \myv {C})$.

Cartesian coordinates

In a right-handed coordinate system: $\uv{x} \times \uv{y} = \uv{z}$.

By compiling all the other unit vector products individually, e.g. $\uv{z} \times \uv{z} = 0$; $\uv{y} \times \uv{x} = - \uv{z}$; etc. you can eventually find that

$\myv{A} \times \myv{B} = (A_x \uv{x} +A_y \uv{y}+A_z\uv{z}) \times (B_x \uv{x} +B_y \uv {y}+B_z \uv{z})=$
$=(A_yB_z-A_zB_y)\uv{x} + (A_zB_x-A_xB_z)\uv{y} +(A_xB_y-A_yB_x)\uv{z}$.

I remember this as the determinant of the three-by-three matrix shown below, which you evaluate by adding the red products, and subtracting the blue products:

Can you see how to use the cross-product to find the direction of the normal to the surface pictured at right? (From symmetry, what do you expect the direction to be?)

What is "direction"?

Can we represent the contents of a box of apples and oranges as a vector? Let:

$\myv{N} = N_a \uv{a} + N_o \uv{o}$.

If another box has $\myv{M} = M_a \uv{a} + M_o \uv{o}$, we can certainly "add" the two quantities in the same way that you add Cartesian vectors...

$$\myv{N} + \myv{M} = (N_a + M_a) \uv{a} + (N_o + M_o) \uv{o},$$

But the vectors that we're used to in physics, such as the displacement vector, can be described in many different coordinate systems: For example, if one coordinate system is rotated by an angle $\phi$ relative to another: The vector in the original coordinate system is...

$\myv A = A_y \uv{y} + A_z \uv{z}$

We can still add the two vectors $A_y \uv{y}$ and $A_z \uv{z}$ in the new coordinate system, but $\uv{y}$ has both a $\bar{y}$ and $\bar{z}$ component in the new system, and so does $\uv{z}$.

If we add the projections of these two vectors along the new $\bar{y}$ direction we should get the $\bar{y}$-coordinate of the vector $\myv A$ in the new system:

$A_{\bar{y}} = \cos \phi\,A_y + \sin \phi\,A_z$.

It turns out that the $\bar{z}$ component is...

$A_{\bar{z}} = -\sin \phi$ $A_y + \cos \phi$ $A_z$.

For example, consider the vector $B=\uv y$. If the "bar" coordinate system is rotated by $\pi/4$ radians from the original coordinate system, we have $\sin(\pi/4)=1/\sqrt 2=\cos(\pi/4)$. So, $$\myv B=B_\bar{y}\hat{\bar{y}}+B_\bar{z}\hat{\bar{z}}=\frac{1}{\sqrt 2}\hat{\bar{y}}-\frac{1}{\sqrt 2}\hat{\bar{z}}.$$ That is to say, in one coordinate system, $\myv B$ has only a $\uv y$ component. But in a different system, $\myv B$ is a superposition (a sum) of $\hat{\bar y}$ and $\hat{\bar z}$ components. It is difficult to imagine a coordinate transformation in which an apple can be considered a superposition of two other fruits!

Matrix representation of rotations

The set of rules ('functions') which gives the components in the new system in terms of the components in the old system, can be written using matrix multiplication...

$$\begincv A_\bar{y}\\A_\bar{z}\endcv = \begincv \cos \phi& \sin \phi\\-\sin \phi& \cos \phi\endcv \begincv A_y\\A_z\endcv.$$

Or as a sum (now, generalizing to three dimensions, with nine constants $R_{ij}$):

$A_\bar{i} = \sum_{j=1}^3 R_{ij} A_j$.

The full 3-dimensional matrix $R$ that accomplishes a rotation about the $x$-axis is...

$$\begincv 1&0&0\\0&\cos \phi& \sin \phi\\0&-\sin \phi& \cos \phi\endcv.$$