# Vectors and Vector Algebra

## Definition

A vector is a mathematical object that has both a magnitude and direction. Think of it as an arrow, not necessarily in our space, which has a length and points in a given direction.

Readings on dials and gages are real numbers, called scalars. Temperature is an example of a scalar quantity. Scalar arithmetic follows the rules for real numbers, which are both positive and negative.

Vectors have their own rules of addition, subtraction and multiplication, which are discussed below.

Fig. 1 Addition of two vectors: C = A +B.

The graphical concept behind the addition of two vectors is simple. Plot the first vector as an arrow, and at the end of the arrow plot the second vector. Then connect the starting point of the first vector to the end point of the second vector, where the new arrow head resides. This idea is illustrated in Fig. 1, where C = A + B.

Unit vectors along x, y and z axes.

## Definition

A vector is a mathematical object that has both a magnitude and direction. Think of it as an arrow, not necessarily in our space, which has a length and points in a given direction.

Readings on dials and gages are real numbers, called scalars. Temperature is an example of a scalar quantity. Scalar arithmetic follows the rules for real numbers, which are both positive and negative.

Vectors have their own rules of addition, subtraction and multiplication, which are discussed below.

Fig. 1 Addition of two vectors:               C = A +B.

The graphical concept behind the addition of two vectors is simple. Plot the first vector as an arrow, and at the end of the arrow plot the second vector. Then connect the starting point of the first vector to the end point of the second vector, where the new arrow head resides. This idea is illustrated in Fig. 1, where C = A + B.

The graphical way of adding vectors is great for visualization of the process, but it is not convenient for doing calculations. To form a more convenient notation, we define a set of unit vectors, e1, e2, e3, which point along the x, y, and z axes, respectively. Using these unit vectors, which are perpendicular to each other in a Cartesian Coordinate System, we can write a vector in this space as a sum of three components

v = e1 v1 + e2v2 + e2v2             (1)

### Scalar products of vectors

A · B = |A| |B| cos(LAtoB)         (2)

where LAtoB is the angle between the vectors A and B.

### The Scalar Product of Vectors

Fig. 2 Unit vectors along x, y and z axes.

Scalar products of the unit vectors, e1, e2, e3  .
From the definition of a scalar product between two vectors (2), we can evaluate the scalar product between two of the unit vectors,

e1·e2 = |e1| |e2| cos(90°)

e1·e2 = 1 * 1 *0

e1· e2 = 0 . Repeating the above procedure for the following scalar product, we get a different result:

e1· e1 = |e1| |e1| cos(0°)

e1· e1 = 1 * 1 * 1

or

e1· e1 = 1.

The scalar products between the orthogonal set of unit vectors e1, e2, e3 can be summed up as follows:

ei · ej = 1 if i equals j and 0 if i is not equal to j.

----------------------------------------------------------------------------------------------------------------

Example 1

Using the expansion (1) for vector A and Vector B find the scalar product between them.

ans.: First write out the vectors in terms of the unit vectors,

A = e1 A1 + e2 A2 + e2 A2

B = e1 B1 + e2 B2 + e2 B2    .

Next, expand out the scalar products,

A.B = e1·e1 A1B1+e1·e2 A1 B2+ e1·e3 A1 B3

+e2·e1 A2 B1+e2·e2 A2 B2+ e2· e3 A2 B3

+e3·e1 A3B1+e3·e2 A3 B2+ e3· e3 A3 B3  ,

and eliminate all the zeros and ones,

A·B =A1B1+ A2 B2+ A3 B3 .

Example 2

Given the following two vectors find their (1) scalar product, (2) magnitudes, and angle between them:

A = 3 e1 + 4 e2 and B= 3 e2  + 4 e3  .

Although it is easy to do most of this problem by inspection, and look up the angle for the cosine obtained from the scalar product, I have included a bit of python code that solves the problem in listing 1 (below).

Note, that by inspection we get the results,

|A|=5, |B|=5 and A·B=12,

so that cos(L_AB)=12.0/(5.*5.)=0.48.

________________________________________________________
ipython --pylab
import math
A1=3
A2=4
A3=0
B1=0
B2=3
B3=4
A=array([A1,A2, A3])
B=array([B1,B2,B3])

A_dot_B=sum(A*B)
Abs_A=sqrt(sum(A*A))
Abs_B=sqrt(sum(B*B))
L_AB=(180./math.pi)*math.acos(A_dot_B/Abs_A/Abs_B)
print A_dot_B,', ', Abs_A,', ', Abs_B,', ', L_AB,'degrees'
# ans.: 61.3145979859 degrees.
#____________________END_____________________________

This entry was posted in mathematics, physics, vectors and tagged , , . Bookmark the permalink.