Vectors and Vector Algebra
Contents
8. Vectors and Vector Algebra¶
We can think of vectors at their heart as directions being given to get between two points in space. If we have to move in one, two or three dimensions, along spatially flat or curved surfaces, we can attempt to give directions. At the heart of a any vector system are the basis vectors, these give us the funadmental possible directions within a vector space, which any vector can be decompsoed into a weighted sum of.
Defintion
In the Cartesian coordinate system, in three dimensions the basis vectors are given as:
When we switch to different coordinate systems, we will consider how these change. Note that a variety of different letters are employed for the Cartessian system:
To see how these visually fit together, see Fig. 8.1. We note that all the coordinates meet at right angles and that we have defined right handed axes.
We can also write coordinates in so-called index notation:
where the value of \(i = \in \{1,\,2,\,3\}\) denotes the specific basis vector.
8.1. Addition and Scaling of Vectors¶
If we start with the basis vectors as building blocks of our coordinate system, then we can write any three dimensional Cartesian coordinate in terms of weighted basis vectors, we can see this in Fig. 8.2.
As an example we can define two vectors \(\bf v_1,\, v_2\)
Then we can add or sutract these vectors:
Likewise we can scale each of the vectors and then proceed to add them:
8.2. Magnitude of a Vector¶
Given some vector, which will take us some distance from two points in space, we can find the shortest path length between the points.
Definition
A magnitude of a vector \({\bf v}\) with \(n\) orthogonal components is:
In two dimensions this would just follow Pythagoras’s theorem:
and in three dimensions a similar relation holds (which we can prove geometrically:
As an example lets consider \(\bf v_1\):
8.3. Normalised Vectors¶
Each of the basis vectors is a normalised vector \(|\hat{\bf x}| = |\hat{\bf y}| = |\hat{\bf z}| = 1\), however if we have a more general vector \({\bf v} = a_x\hat{\bf x} + a_y\hat{\bf y} + a_z\hat{\bf z}\) moving in some direction, we can also construct a normalised vector:
Definition
Example
8.4. Scalar Product / Dot Product¶
Lets consider two vectors \(\bf A,\, B\), as shown in Fig. 8.3. We can consider the scalar projection of the vector \(\bf B\) on to the vector \(\bf A\), where we resolve the parallel components of \(\bf B\) in the direction of vector \(\bf A\).
If we multiply these two distances, this is known as the scalar product of the vectors.
Geometric definition
The scalar product (also called the dot product) is given by:
So we can calculate the scalar projection of \(\bf B\) onto vector \(\bf A\) using \({\bf A \cdot B} / |{\bf A}|\). Likewise we can think about the scalar projection of \(\bf A\) onto the vector \(\bf B\), using \(\displaystyle \frac{\bf A \cdot B}{|{\bf B}|}\).
We can also find the magntiude of a vector from \(\bf A \cdot A = |A|^2 \).
Algebraic definition
There is another perspective on the scalar product, which is for two vectors with components:
the dot product can be found algebraically by:
where the last expression uses the index notation.
8.4.1. Properties of the Dot Product¶
The dot product of two vectors \(\bf a,\, b\) have the following mathematical properties:
1. Commutative: \(\mathbf {a} \cdot \mathbf {b} = \mathbf {b} \cdot \mathbf {a}\)
2. Distributive over Vector Addition: \( \mathbf {a} \cdot (\mathbf {b} +\mathbf {c} )=\mathbf {a} \cdot \mathbf {b} +\mathbf {a} \cdot \mathbf {c}\)
3. Bilinear: \( \mathbf {a} \cdot (r\mathbf {b} +\mathbf {c} )=r(\mathbf {a} \cdot \mathbf {b} )+(\mathbf {a} \cdot \mathbf {c} )\)
4. Scalar Multiplication: \( (c_{1}\mathbf {a} )\cdot (c_{2}\mathbf {b} )=c_{1}c_{2}(\mathbf {a} \cdot \mathbf {b} )\)
5. Orthogonal: Two non-zero vectors \(\bf a,\, b\) are orthogonal if and only if \(\bf a \cdot b = 0\).
8.5. Vector Product / Cross Product¶
Unsurprisingly we can also make a vector product that results in a vector, rather than a scalar, this is known as the Vector product, also caleed the Cross product.
Geometric definition
The cross product can be constructed from the basis vectors:
In general however we write the cross product between two vectors as a new vector, normal to the other two (following the right hand rule), as depicted in Fig. 8.4.
This means that if vectors span an angle \(\theta\), then we need to resolve the perpendicular component:
where \(\hat{\bf n}\) is vector which is normal to both \(\bf a,\, b\).
Because the cross product follows the right hand rule for axes, it is anti-commutative:
We also find the at the cross product is distributive over addition,
and compatible with scalar multiplication:
Likewise since the vector magnitude depends on the angle between the two vectors, if we cross a vector with itself (or another vector that is parallel / anti-parallel), the answer is zero:
where \(\bf 0\) is a zero vector.
Once again there is also an algebraic route to the cross product, this is based on the vector components.
Since the cross product is distributive over addition we find that:
If we follow through our rules for computing the cross products of basis vectors, we find this simplifies to:
Algebraic definition
Finding the cross product can be found using a matrix determinant:
which by the cofactor method along the first row produces:
which we find are equivalent definitions.
8.6. Triple Vector Products¶
Now that we have multiplcation of two vectors formalised, we find that multiplying three vectors also leads to some further geometric and algebraic ideas.
8.6.1. Triple Scalar Product¶
Here we have three vectors \(\bf a, \,b,\,c\) composed so that
since the combination of \(\bf b \times c\) produces a vector, which we can then do a scalar multiplcation with \(\bf a\). Therefore this produces a scalar result.
Geometrically this is related to the parallepiped, as depicted in Fig. 8.5, where the magnitude of this result is the shapes volume:
We can also evaluate the triple scalar product from a matrix determinant:
8.6.2. Triple Vector Product¶
Unsurprisingly we can also find an expression for the vector product between three vectors \(\bf a, \,b,\,c\):
which is useful particularly when we want to work out results like:
which will be useful later!
8.7. Vector Lines and Planes¶
We can identify points in space using their position vectors, which are typically denoted by
This gives us two ways of writing down the equations of lines and planes:
Vector Form: in terms of the position vector \(\bf r\),
Scalar Form: in terms of the coordinates \(x,\, y,\, z\).
In what follows, we will write the equations using both conventions. You will see that sometimes it is easier to work with the scalar equations and other times it is easier to work with the vector equations.
8.7.1. Equation of a Line¶
The vector equation of a line can be obtained from a known point on the line and a known vector parallel to the line. Equivalently, two known points on the line can also be used to find a parallel vector.
We obtain the position vector of the other points by a two step process:
first carrying from the origin to the known point
secondly carrying along the line in either direction
This principle is illustrated in Fig. 8.6
An arbitrary scalar parameter \(\lambda\) controls how far along the line we move, and if it is negative then the direction is reversed. The animation shows how the line is described as the parameter \(\lambda\) is varied.
We can also use the vector equation to calculate the corresponding scalar equation. From the vector equation we obtain:
Equating components on the left and right and rearranging in each equation for \(\lambda\) then gives the result in vector form :
or in scalar form:
where \({\bf r_0}=\begin{pmatrix} x_0\\y_0\\z_0\end{pmatrix}\) is the position vector of a point on the line, and \({\bf v}=\begin{pmatrix} v_x\\v_y\\v_z\end{pmatrix}\) is a vector parallel to the line. Notice that the special case where \(z\) is constant gives an equation of the form \(y = m x+c\)
Worked example
Find the vector equation of the lines:
By setting each of these equations to equal some constant \(\lambda\):
we find the vector equation as:
8.7.2. Equation of a Plane¶
The vector equation requires either three points (which cannot lie all on the same line), or a point and two non-parallel directions. The vector form of the equation is illustrated in Fig. 8.7.
In this description we carry from the origin to the known point identified by \({\bf r}_0\) and then carry along the resultant of vectors \(\lambda{\bf v}\) and \(\mu{\bf w}\), which span a parallelogram within the plane.
Written out in scalar form, the vector equation of a plane gives :
In principle, we could find the scalar equation for a plane by eliminating the parameters \(\lambda,\mu\) between these equations, which would lead to a relationship of the form \(ax +by+cz=k\). However, we can avoid the messy algebra by obtaining the scalar equation in a different way.
We can find the scalar equation of a plane if we know the position vector \(\bf r_0\) of a point on the surface, and a vector \(n\) that is normal to the surface. Then, \({\bf r}-{\bf r}_0\) lies inside the plane, so it is perpendicular to \(n\).
This gives the result that the scalar equation of a plane is given by:
where \({\bf r}_0\) is the position vector of a point in the plane, and \({\bf n}\) is a vector perpendicular to the plane. We see this depicted in Fig. 8.8.
Expanding out the scalar product gives:
where \(k=n_x \,x_0 +n_y \,y_0 + n_z\, z_0\)
In the case where we are given two vectors \(v,\,w\) lying inside the plane we can, of course, find a normal vector by making use of the vector product!
So, we could write:
Worked example
Find equation of the plane going through the point \((3,\,2,\,7)\) which is perpendicular to the vector:
In the scalar form we can write \(({\bf r - r_0})\cdot {\bf n} = 0\) as:
which gives the scalar equation \(x - 5y + 8z = 49\)
Equally in the vector form, firstly find two vectors which lie in the plane - we can use our scalar equation to find these, e.g. \((1,\,0,\,6)\) and \(\displaystyle \Big(0,\,1,\,\frac{27}{4}\Big)\), thus we can find the vectors:
and therefore we have:
which is just one of an infinite number of solutions!
8.7.3. Distance between a Point and a Line¶
The shortest distance between a point \(C\) and a line through points \(A,B\) is the perpendicular distance, \(d=|\overrightarrow{AC}_{\perp}|\), illustrated in Fig. 8.9
This distance is equal to the height of the parallelogram spanned by vectors \(\overrightarrow{AB}\) and \(\overrightarrow{AC}\), so it can be found using the vector product:
Alternatively, we could use the scalar product, since
in which the parallel component \(\overrightarrow{AC}_{\parallel}\) is simply the projection of \(\overrightarrow{AC}\) onto \(\overrightarrow{AB}\).
Worked example
Find the shortest distance between the point \(C:(5,0,5)\) and the line that passes through the points \(A:(1,1,3)\) and \(B:(3,4,2)\).
By using the vector product:
Or by using the scalar product:
8.7.4. Shortest Distance to a Plane¶
The shortest distance between a point \(P\) and a plane containing the point \(A\) is the perpendicular distance, marked \(d\) in Fig. 8.10
This distance is the given by projecting vector \(\overrightarrow{AP}\) onto the unit normal:
The shortest distance between a line and a (non-intersecting) plane, two parallel planes, or two skew lines can be found in the same way, by picking any point on each line/plane. The case of two skew lines is illustrated in Fig. 8.11
Worked example
Find the shortest distance between the planes:
Given that the two planes are parallel, with normal direction:
We have to pick a point on each plane - e.g. on \(P_1\) pick \(A:(0,0,3)\) and on \(P_2\) pick \(B:(0,0,1)\), then the distance between the two planes is given by: