Professional Documents
Culture Documents
Note: 1. In Matlab (or Octave), vectors and matrices are expressed in the same way as
the above. However, in Python, column vectors and matrices are expressed in a
different way. See the Python files (pmath01.py and pmath02.py) for more detail.
2. Vectors can have physical meanings. For example, the position of an object P on a
plane can be expressed as a vector. Suppose we use the x and y axes to denote the
position, and suppose P is located at x=3 and y=4. That is, the position vector of P
(relative to the origin) is [3, 4]. It is clear that this position vector is characterized by
its magnitude (which is the squared root of 32+42 in this case) and direction (the angle
measured relative to x or y axis).
3. Two vectors are equal as long as they have the same magnitude and direction.
Usually they don’t have to be coincident. In some cases, as in force application, we
may need to consider whether two vectors are coincident.
The unit vector of vector a is usually denoted as â and is defined as a/|a|, where |a|2 is
(a1)2 + (a2)2 + (a3)2.
Dot product:
The dot product of two vectors is a scalar. For example, a·b = |a||b|cosθ, where θ is the
angle between the two vectors. Thus, a·b = a1b1 + a2b2 + a3b3
The dot product is commutative and distributive. That is, a·b = b·a , and a·(b + c) =
a·b + a·c
Cross product:
The cross product of two vectors is a vector. For example, a×b = c, where |c| = |a||b|
sinθ. The direction of c is perpendicular to both a and b, and is obtained using the
right-hand rule.
a×b = -b×a
a×(b × c) = (a·c)b – (a·b)c
a·(b × c) = b·(c × a) = c·(a × b)
Also, a cross product between two vectors can be written as the product of a skew-
symmetric matrix and a column vector. That is, let a = [a1; a2; a3] and b = [b1; b2; b3].
Then, a×b (expressed as a column vector) =
Note that matrix multiplication is to perform dot products for the corresponding rows
and columns. If you are not familiar with matrix multiplication, some examples can
be found here: How to Multiply Matrices (mathsisfun.com)