More on vectors and transformations
1. Scalar products and vector products.
We can take the scalar product of a force and a
displacement for calculating work done. Since
moving perpendicular to a force involves no work, the
only contributions to work done will be from each
component of force multiplied by its corresponding
component of distance.
If we represent the force as vector (F
x, F
y,
F
z) and the distance as vector (x, y, z) we
have
work = x Fx
+ y Fy + z Fz
This is the 'dot product' of the vectors (F
x,
F
y, F
z) and (x, y, z).
It is not hard to show that the 'dot product' is the
product of the vector's magnitudes, multiplied by the
cosine of the angle between them. An alternative
description is that it is the magnitude of the first
vector, multiplied by the component of the second
vector resolved in the direction of the first.
But how about calculating the moment of a force?
Suppose that the force (F
x, F
y,
F
z) operates through the point (x, y, z)
and we wish to know the moment about the origin.
We could try dropping normals and other complicated
things, but it is easier to consider the result
component by component.
A force (0, F
y, 0) applied at (x, 0, 0) is
easy to imagine.
In the x-y plane, the force is "up the page" and acts
to the right of the origin. It therefore screws
anticlockwise - a corkscrew would rise upwards.
That is the positive z-direction, and we have a
convention that we consider that to be a positive
component of the couple.
So we have a contribution x F
y to the
z component of the couple.
On the other hand, a force (F
x, 0, 0)
applied at (0, y, 0) would have a clockwise effect - a
negative couple about the z axis.
All other products are either zero - because the force
component is through the origin - or in some other
axis direction.
So if we reintroduce our unit vectors
i,
j and
k, we have a
component
(x Fy - y Fx)
k
and for the combined result of a force acting in three
dimensions we will get
(y Fz - z Fy)
i +
(z Fx - x Fz) j + (x Fy
- y Fx) k
which we could write as the determinant of the matrix
We have an expression for the scalar product in terms
of the angle between the vectors. The vector product
is only a little more awkward.
It is the product of the vector magnitudes, multiplied
by the sine of the angle between them. It is a
vector, orthogonal to both of the input vectors.
If you think of the two vectors as defining two sides
of a parallelogram in space, the vector product is
equal to the area of the parallelogram and is a vector
perpendicular to its surface.
So if we use subscript notation we have
b x c
= det
|
i
j k
b1 b2
b3
c1 c2
c3 |
Now let us introduce another vector
a. With all
three vectors acting through the origin, we can regard
them as edges of a parallelepiped - a sort of
three-dimensional parallelogram.
We know the area of the
b c
face - it is the magnitude of
b x
c.
To find the volume, we must multiply this by the the
resolved component of
a perpendicular to the face.
But
b x
c is already a
vector in that direction, so we just have to take the
scalar product of
a
with
b x
c.
It is not hard to see that we can get this result by
replacing
i,
j and
k in the
determinant above with the components of
a, to get
|
volume = det |
a1
a2 a3
b1 b2
b3
c1 c2
c3 |
|
(We would get the same numerical result if we
transposed the matrix so that the vectors appeared as
columns instead of rows)
Now we can start to make all sorts of deductions about
the vectors if the determinant is zero.
One of the vectors might have magnitude zero.
Two of the vectors might be equal - or at least in the
same direction
More generally, the three vectors might lie in a
single plane.
Let us call the matrix made of the three column
vectors A.
2. Rotations
Let us suppose that
a,
b and
c are three very
healthy unit vectors, orthogonal to each other.
They could become an alternative set of coordinate
axes.
That means that
a.
a = 1,
b.
b = 1 and
c.
c = 1
Also, since the vectors are orthogonal, the scalar
product of any two different vectors is zero, e.g.
a.
b = 0.
Let us consider the product of A with its transpose:
|
A' A =
|
a1
a2 a3
b1 b2
b3
c1 c2
c3 |
|
a1 b1
c1
a2 b2
c2
a3 b3
c3 |
Remember the 'scalar products' way to look at matrix
multiplication. We see that
|
A' A =
|
a.a
a.b
a.c
b.a
b.b b.c
c.a
c.b
c.c |
|
But from what we know of these scalar products
So
A' A = I
or
A' = A-1
It is extremely easy to invert!
So how did we get this wonderful matrix? It has
columns composed of three othogonal unit vectors -
just what we need for an alternative frame of
reference. So a vector which has coordinates
y in this
frame of reference will have coordinates
A y
in the original frame. On the other hand a point
with coordinates
x in the original frame will in
this new frame be
A-1
x
which is the same as
A' x
for this
unitary matrix
This matrix A has a good chance of representing a
rotation of the coordinate frame from the first set of
orthogonal vectors
i,
j and
k to this new set,
through the same origin. But we still have to
take care. Consider the matrix
Its rows are orthogonal and of unit size, but this A
will make a reflection of the x-axis. A
left-hand glove would become a right-hand glove, not a
rotated glove. So to avoid this, we must insist
that if A is to be a rotation, its determinant must be
1.
3. Translations
When looking at three-dimensional coordinates, we can
rotate the frame of axes or we can move it with a
displacement. Althernatively we can leave the
frame alone and move the point about - the mathematics
will be the same.
When a point (x, y, z)' is moved a vector distance (1,
2, 3)' it arrives at
(x + 1, y + 2, z + 3)' - it's not really
difficult! To find the new vector we simply add
the displacement to it.
The problem is that we now have to use two different
processes to deal with the two types of movement,
rotation and translation. Can we find some way
of glueing them together into a single
operation? If we can, we can start to deal with
combinations of transformations, such as 'screwing'
where the object is rotated at the same time as being
moved along the rotation axis.
We have to appease the mathematicians! Rotation
is a transformation given by a simple multiplication
of a vector by a matrix, but the ability to add a
constant to the result requires an
affine
transformation.
However there is a way around the problem.
Suppose that instead of writing our vector as (x, y,
z)' we write it as (x, y, z, 1)'.
What is the 1 for? It gives something for a
matrix to grab onto to add a translation
d to the
vector! But now the vector has four components
and the matrix is 4 x 4.
We can 'partition' a matrix to see its various parts
in action, so if we write T
x for the
product of our point with a transformation matrix, now
4 x 4, we can break it down as follows.
|
A
|
d
|
|
x
|
=
|
A
x + d
|
|
0
0 0
|
1
|
|
1
|
|
1
|
So at the expense of changing our matrices to 4 x 4,
where the bottom row is always (0, 0, 0, 1), we can
apply any combination of rotations and translations,
just by multiplying the T matrices together.
This transformation is called the Denavit Hartenberg
(or D-H) matrix.