Linear Algebra / Unit 1, Vectors / Topic 1.5
Unit 1. Vectors
This topic defines the cross product, a product of two vectors in three dimensions. The result is a vector that is perpendicular to both of the original vectors, and its length is the area of the parallelogram that they form.
You need Topics 1.1, 1.2, and 1.3 for this topic.
The dot product of two vectors is a number. The cross product of two vectors is a vector. It is defined only for vectors with three components.
u × v = (u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁)The subscripts follow a pattern. The first component uses the subscripts 2 and 3, the second component uses 3 and 1, and the third component uses 1 and 2. In each component, the second term has the same two subscripts in the opposite order, with a minus sign.
For example, take u = (1, 2, 3) and v = (4, 5, 6).
u × v = ((2)(6) − (3)(5), (3)(4) − (1)(6), (1)(5) − (2)(4))the formula, one component at a timeu × v = (12 − 15, 12 − 6, 5 − 8)multiplyu × v = (−3, 6, −3)subtractFrom Topic 1.2, two vectors are perpendicular when their dot product is 0. Test the result of the example against u and against v.
u · (u × v) = (1)(−3) + (2)(6) + (3)(−3)multiply the matching componentsu · (u × v) = −3 + 12 − 9 = 0the result is perpendicular to uv · (u × v) = (4)(−3) + (5)(6) + (6)(−3)multiply the matching componentsv · (u × v) = −12 + 30 − 18 = 0the result is perpendicular to vThis is true for any two vectors, and it is the main reason that the cross product is useful. You can prove it by writing out u · (u × v) with the definition. The six terms cancel in pairs.
If θ is the angle between u and v, the length of the cross product is
|u × v| = |u| |v| sin θThis is the area of the parallelogram that has u and v as two of its sides. The base of the parallelogram is |u|, and its height is |v| sin θ.
For example, take u = (2, 0, 0) and v = (1, 3, 0). Both vectors are in the xy-plane.
u × v = ((0)(0) − (0)(3), (0)(1) − (2)(0), (2)(3) − (0)(1))the formula, one component at a timeu × v = (0, 0, 6)only the third component is not zeroThe length of this vector is 6. The parallelogram has a base of 2 and a height of 3, so its area is also 6. The cross product points along the z-axis, which is perpendicular to the xy-plane.
Compare the two products. The dot product contains cos θ, so it is largest when the vectors are parallel and it is 0 when they are perpendicular. The cross product contains sin θ, so it is largest when the vectors are perpendicular and it is the zero vector when they are parallel.
When u and v are parallel, the parallelogram is flat and has no area, so u × v = 0. In particular, u × u = 0 for any vector u.
Two directions are perpendicular to both u and v, and they are opposite to each other. The right-hand rule tells which one the cross product takes. Point the fingers of your right hand along u. Turn your hand so that you can curl the fingers toward v through the smaller angle. Your thumb then points along u × v.
For vectors in the xy-plane, with the x-axis to the right and the y-axis up the page, the z-axis points out of the page toward you. If the turn from u to v is counterclockwise, the cross product points out of the page. If the turn is clockwise, the cross product points into the page.
Try it: the cross product of two vectors in the plane
The two vectors are in the plane of the page, so each has a third component of 0. Drag the tips of u and v. The shaded region is the parallelogram. The symbol at its center shows whether u × v points out of the page or into the page.
The standard unit vectors from Topic 1.4 give the simplest examples of the right-hand rule.
e₁ × e₂ = e₃ e₂ × e₃ = e₁ e₃ × e₁ = e₂In physics notation, these are î × ĵ = k̂, ĵ × k̂ = î, and k̂ × î = ĵ.
The order matters. Exchanging the two vectors reverses the direction of the result.
v × u = −(u × v)In the drawing above, press Swap u and v to see the direction reverse.
The cross product works with addition and scalar multiplication in the expected way.
(cu) × v = c(u × v) u × (v + w) = u × v + u × wThe parentheses cannot be moved. In general, (u × v) × w is not equal to u × (v × w). For example, (e₁ × e₁) × e₂ = 0, because e₁ × e₁ = 0. But e₁ × (e₁ × e₂) = e₁ × e₃ = −e₂.
In Topic 1.3, the equation of a plane needed a normal vector, which is a vector perpendicular to the plane. The cross product gives one. If u and v are two directions in the plane that are not parallel, then u × v is perpendicular to both of them, so it is a normal vector of the plane.
For example, find the plane through the three points A = (1, 0, 0), B = (0, 2, 0), and C = (0, 0, 3). Two directions in the plane are
u = B − A = (−1, 2, 0) v = C − A = (−1, 0, 3)Their cross product is a normal vector.
n = u × va vector that is perpendicular to both directionsn = ((2)(3) − (0)(0), (0)(−1) − (−1)(3), (−1)(0) − (2)(−1))the formula, one component at a timen = (6, 3, 2)the normal vectorThe right side of the equation is n · A = 6, so the plane is
6x + 3y + 2z = 6Check: each of the three points satisfies this equation.
Several quantities in physics are defined as cross products.
| Quantity | Definition |
|---|---|
| Torque | τ = r × F |
| Angular momentum | L = r × p |
| Magnetic force on a moving charge | F = qv × B |
For example, a force F = (0, 3, 0) newtons acts at the position r = (2, 0, 0) meters from an axis. The torque is r × F = (0, 0, 6) newton meters. It points out of the page, which matches a counterclockwise turn. The length of the torque, 6 newton meters, is r F sin θ with θ = 90°.
Three vectors u, v, and w that start at one point are the edges of a slanted box, called a parallelepiped. Its volume comes from a cross product followed by a dot product.
volume = |u · (v × w)|The number u · (v × w) is called the scalar triple product. For u = (1, 0, 0), v = (0, 2, 0), and w = (0, 0, 3), the cross product is v × w = (6, 0, 0), and the dot product with u is 6. The box has the sides 1, 2, and 3, so its volume is 6.
When the scalar triple product is 0, the box is flat, and the three vectors lie in one plane. This number appears again in Topic 3.4 as the determinant of a 3 by 3 matrix.
| Fact | Statement |
|---|---|
| Definition | (u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁) |
| Direction | Perpendicular to u and to v, by the right-hand rule |
| Length | |u| |v| sin θ, the area of the parallelogram |
| Parallel vectors | u × v = 0 |
| Order | v × u = −(u × v) |
| Scalar triple product | u · (v × w), whose size is the volume of the box |
Work each problem on paper first. Then open the answer to check your work.
The first two components are 0, because both vectors have a third component of 0.
third component = (2)(3) − (1)(1) = 5
The result is (0, 0, 5).
cross product = ((0)(1) − (2)(1), (2)(0) − (1)(1), (1)(1) − (0)(0))the formula, one component at a timecross product = (−2, −1, 1)(1)(−2) + (0)(−1) + (2)(1) = 0the check with the first vector(0)(−2) + (1)(−1) + (1)(1) = 0the check with the second vector
Two sides of the triangle are u = (2, 0, 1) and v = (1, 1, 0).
u × v = (−1, 1, 2)the cross product of the two sides|u × v| = √1 + 1 + 4 = √6the area of the parallelogramarea = √6/2 ≈ 1.22the triangle is half of the parallelogram
cross product = (12 − 12, 6 − 6, 4 − 4) = (0, 0, 0)each component is 0
The second vector is 2 times the first vector, so the two vectors are parallel and the parallelogram has no area.
u = (0, 1, 1) − (1, 1, 0) = (−1, 0, 1)one direction in the planev = (1, 0, 1) − (1, 1, 0) = (0, −1, 1)a second direction in the planen = ((0)(1) − (1)(−1), (1)(0) − (−1)(1), (−1)(−1) − (0)(0))the cross product u × vn = (1, 1, 1)the normal vectorn · (1, 1, 0) = 1 + 1 + 0 = 2the right side of the equationx + y + z = 2the equation of the plane
τ = r × Fthe torqueτ = ((0)(−10) − (0)(0), (0)(0) − (0.5)(−10), (0.5)(0) − (0)(0))the formula, one component at a timeτ = (0, 5, 0) newton meters
Python reads the code one line at a time, from the top to the bottom. The equals sign stores the value on its right under the name on its left, and print shows a result. A vector is written as np.array([1, 2, 3]), where np stands for NumPy, the part of Python that works with vectors and matrices.
The instruction np.cross calculates a cross product. The names of the two vectors go inside the parentheses, with a comma between them. The code below calculates the example from Part 1 of this topic.
Python
The result is [-3 6 -3], as in Part 1.
Now change the last line so that it prints v × u, the cross product in the other order.
Python
Each component has the opposite sign, as Part 5 states.
The code below stores the cross product under the name n, and then calculates its dot product with each of the two vectors. The instruction np.dot calculates a dot product.
Python
Both results are 0, so the cross product is perpendicular to u and to v. Change the components of u and v to any other numbers and run the code again. Both results are 0 each time.
The length of the cross product is the area of the parallelogram. The instruction np.linalg.norm calculates the length of a vector. The code below uses the triangle with the vertices A = (1, 0, 0), B = (0, 2, 0), and C = (0, 0, 3). The fourth and fifth lines find two sides of the triangle by subtracting the vertices.
Python
The result is 7.0. This is the area of the parallelogram with the sides u and v.
In the next box, change the line that calculates the area so that it gives the area of the triangle ABC. The triangle is half of the parallelogram. The / sign means division.
Python
The code below finds the plane from Part 6 of this topic. The cross product of two directions in the plane is a normal vector n, and the right side of the equation is d = n · A.
Python
The results are [6 3 2] and 6, so the plane is 6x + 3y + 2z = 6.
Now change the three points to the ones in Practice Problem 5: (1, 1, 0), (0, 1, 1), and (1, 0, 1). Compare the result with your answer.
Python
The code below calculates the torque from Part 7 of this topic. The position is in meters, and the force is in newtons.
Python
The result is [0 0 6], a torque of 6 newton meters along the z-axis.
Now calculate the torque in Practice Problem 6. The force is (0, 0, −10) newtons, and it acts at the position (0.5, 0, 0) meters.
Python
The torque is 5 newton meters along the y-axis. Python prints the first component as -0. with a minus sign. This value is the same as 0.
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. Calculate the cross product (1, 0, 2) × (3, 1, 0).
first component = (0)(0) − (2)(1) = −2second component = (2)(3) − (1)(0) = 6third component = (1)(1) − (0)(3) = 1
2. Two vectors have the cross product u × v = (2, −1, 4). What is v × u?
Exchanging the two vectors reverses the direction of the result: v × u = −(u × v).
3. Find the area of the parallelogram with the sides (3, 0, 0) and (1, 2, 0).
The cross product is (0, 0, 6). The area of the parallelogram is the length of the cross product, which is 6.
4. What is the cross product of (2, 4, −6) and (1, 2, −3)?
The first vector is 2 times the second vector, so the two vectors are parallel. The cross product of parallel vectors is the zero vector.
5. A force F = (5, 0, 0) newtons acts at the position r = (0, 2, 0) meters. Find the torque r × F, in newton meters.
first component = (2)(0) − (0)(0) = 0second component = (0)(5) − (0)(0) = 0third component = (0)(0) − (2)(5) = −10