- 1. Vectors - Revision
- 1.1 The connection between vectors and Cartesian coordinates
- 1.2 The dot product
- 1.3 The vector or cross product
- 1.4 Geometrical treatment of the cross product
- 1.4.1 The cross product as an area
- 1.5 The scalar triple product and volume
- 1.6 The vector triple product
- 2. The Geometry of Lines & Planes
- 2.1 The Equation of a line
- 3. Ordinary Derivatives of Vectors
- 4. Frenet-Serret Frame
- 5. Partial Derivatives & Fields
- 6. Taylor’s in One and Several Dimensions
- 7. Gradient, Divergence & Curl
- 8. Techniques in Vector Differentiation
- 9. Line Integrals
- 10. Theory of Integration
- 11. The Limits of Integration are Not Constants Anymore
- 12. Integrals Over Surfaces & Volumes
- 13. Curvilinear Coordinate Systems
- 14. Special Integrals Involving Curvilinear Coordinates
1. Vectors - Revision
import numpy as np
λ = 5 # real number
a = np.array([1,3,5]) # vector 1
b = np.array([2,4,6]) # vector 2
c = a + b # vector addition
d = λ * a # scalar Multiplication
print(c) # prints [3, 7, 11]
print(d) # prints [5, 15, 25]
import numpy as np
a = np.array([1,3,5]) # vector 1
b = np.array([2,4,6]) # vector 2
a_dot_b = np.dot(a,b) # dot product
print(a_dot_b) # prints 44
import numpy as np
import numpy.linalg as la
b = np.array([3,4,5]) # vector 1
c = np.array([5,8,13]) # vector 2
def mag(vector):
magnitude = np.sqrt(np.dot(a,a))
return magnitude
magnitude_of_b = mag(b)
print(magnitude_of_b) # 5\sqrt{2}
# Alternatively
magnitude_of_c = la.norm(c)
print(magnitude_of_c) # approx. 16.06
import numpy as np
import numpy.linalg as la
a = np.array([ 1,1,1]) # vector 1
b = np.array([-1,1,1]) # vector 2
def angle(vector1,vector2):
v12 = np.dot(vector1,vector2)
# perform dot product
v1 = la.norm(vector1,vector1)
v2 = la.norm(vector2,vector2)
# Mag of each vector
cosine = v12/(v1 * v2)
theta = np.arcos(cosine)
# return the angle between them
return theta
theta_ab = angle(a,b)
print(theta_ab) # approx. 1.23 rads
import numpy as np
a = np.array([1,3,5]) # vector 1
b = np.array([5,1,3]) # vector 2
a_cross_b = np.cross(a,b)
print(a_cross_b) # [ 4, 22, -16]
1.1 The connection between vectors and Cartesian coordinates
A vector is a quantity with magnitude and direction. A point in space can be labelled by coordinates with respect to some Cartesian coordinate frame with the origin defined as . The distance from to is
Associated with and is a direction - from to . One can identify a vector with this direction, which has a magnitude . This vector can also be defined by its coordinates, which is written as
Two vectors, and can be added together. This creates a new vector whose components are simply the sum of the relevant components of and .
This is consistent with the parallelogram law of vector addition - see Fig. 1.1. There is also a notion of scalar multiplication: if and if , then
One can also identify unit vectors (vectors of length one, sometimes you’ll hear this referred to as unity) that point along the three different, mutually perpendicular directions of the Cartesian frame:
This means one can write a vector as
which adds further consistency to the identification of triplets of numbers with vectors.
1.2 The dot product
Definition 1.1 Consider two vectors and . The dot product is a combination of these two vectors that returns a scalar, and is defined as:
The dot product inherits much of the same properties as ordinary multiplication:
- Commutative:
- Distributive:
for all , and in . Here denotes all triples , where , and are real numbers; equivalently, it denotes all points in three-dimensional space.
The dot product can also be used to compute the magnitude of a vector:
From here on the magnitude of a vector will be defined as . Using the properties of the dot-product, the following theorem can be proven:
Theorem 1.1 Let and be vectors in . Then
where is the angle between and .
Proof: Introduce a new vector and apply the laws of dot-product multiplication to obtain
Referring to the triangle in Fig. 1.2, one can apply the cosine rule for the side length and obtain
Comparing this expression with the previous one, the desired result is acquired.
Corollary 1.1 Two vectors and are orthogonal (perpendicular) if and only if their dot product is zero
Not surprisingly these vectors have a zero dot product as they point along different mutually-perpendicular axes. The vectors , and are called an orthogonal triad.
1.3 The vector or cross product
In the previous section it was shown how two vectors can form a scalar. In this section it will be shown how two vectors can be used to construct a third.
Definition 1.2 (Cross Product)
The double lines either side of the “matrix” just mean that one takes the determinant of this matrix. Its worth mentioning that this isn’t a true matrix since not all elements of the matrix are scalars, the top row are vectors, but this formula treats them as scalars.
Properties of the cross product:
- Skew-symmetry:
- Linearity:
- Distributive:
From these properties we can see that :
Thus it can be deduced that when vectors are parallel their cross product will be zero.
Then the cross product is:
The orthogonal triad , and satisfy the following:
1.4 Geometrical treatment of the cross product
The definition provided previously for the cross product was in terms of the Cartesian coordinate system, however the cross product is independent of coordinate choice. In this section we re-construct the cross product
First: Finding the magnitude of
From the previous section we can note the following
Where
Second: Finding the direction of
Similarly from the previous section we can note the following
Hence, is a vector that is perpendicular to both and . It remains to find the sense of . This is an arbitrary choice and must be fixed. The right-hand rule is how we fix this (fig. 1.3) Choosing a right handed system means the relations for the orthogonal triad , and are satisfied.
In summary , is a vector of magnitude , that is orthogonal to both and , and whose sense is determined by the right hand rule.
1.4.1 The cross product as an area
Consider a parallelogram, whose two adjacent sides are made up of vectors and (fig. 1.4). The area of the parallelogram is
1.5 The scalar triple product and volume
A scalar can be formed from three vectors , and by combining the dot and cross product as follows
This is the so-called ‘scalar triple product’.
Theorem 1.3 The scalar triple product is equivalent to
Proof: By brute force.
Now consider a parallelepiped spanned by the vectors , and (Fig. 1.5)
Corollary 1.2: Three nonzero vectors , and are considered coplanar if and only if . This equation only holds if the volume of the parallelepiped spanned by those three vectors is zero, this occurs when the perpendicular height is zero which happens when all three vectors lie within the same plane.
1.6 The vector triple product
Given three vectors , and , we can form a fourth vector
The brackets are important since the cross product is not associative
Theorem 1.3 The vector triple product satisfies
Proof: Without loss of generality, we can show this equality is true in a frame where and lie in the x-y plane. The idea here is that quantities, such as the above, are frame independent. So we can always rotate to a frame that is more convenient. It is possible to keep it completely general and bash out the above equality by hand but that is quite tedious. So defining the vectors as follows
Then Fig. 1.1 The Parallelogram law of vector addition
2. The Geometry of Lines & Planes
This section shows how vector operations are used to describe lines and planes in three dimensions. These ideas are important as they lay the groundwork for dealing with general (smooth) curved lines and surfaces which can be approximated to arbitrary precision by collections of line segments and planar surfaces.
2.1 The Equation of a line
The problem here is to find the equation of a straight line which passes through two given points and having position vectors and with respect to an origin .
The solution is to let be the position of any point on the line through and
and
Since and are colinear we can say
This means that only two vectors are needed to specify a line in space. One vector the lies somewhere on the line and another vector that lies parallel to the line . So we can write the equation of a line
We say that a straight line is a one parameter curve.