Scientia sine finibus

Linear Algebra / Unit 1, Vectors / Topic 1.5

Units and Topics

Unit 1. Vectors

1.5 The Cross Product

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.

1. The Definition

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)subtract

2. The Cross Product Is Perpendicular to Both Vectors

From 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 v

This 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.

3. The Length of the Cross Product

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 zero

The 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.

4. The Direction of the Cross Product

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̂ × î = ĵ.

5. The Rules of the Cross Product

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 × w

The 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₂.

6. A Normal Vector for a Plane

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 vector

The right side of the equation is n · A = 6, so the plane is

6x + 3y + 2z = 6

Check: each of the three points satisfies this equation.

7. The Cross Product in Physics

Several quantities in physics are defined as cross products.

QuantityDefinition
Torqueτ = r × F
Angular momentumL = r × p
Magnetic force on a moving chargeF = 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°.

8. The Volume of a Box

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.

Common Mistakes

  • Treating the cross product as a number. The cross product of two vectors is a vector. The dot product is a number.
  • Changing the order of the vectors. v × u is the opposite of u × v.
  • Getting the sign of the second component wrong. The second component is u₃v₁ − u₁v₃.
  • Using the left hand for the right-hand rule.
  • Taking the cross product of vectors with two components. Give each vector a third component of 0 first.
  • Moving the parentheses in a product of three vectors. (u × v) × w and u × (v × w) are usually different.

Summary

FactStatement
Definition(u₂v₃ − u₃v₂, u₃v₁ − u₁v₃, u₁v₂ − u₂v₁)
DirectionPerpendicular to u and to v, by the right-hand rule
Length|u| |v| sin θ, the area of the parallelogram
Parallel vectorsu × v = 0
Orderv × u = −(u × v)
Scalar triple productu · (v × w), whose size is the volume of the box

Practice

Work each problem on paper first. Then open the answer to check your work.

1. Calculate (2, 1, 0) × (1, 3, 0).

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).

2. Calculate (1, 0, 2) × (0, 1, 1), and check that the result is perpendicular to both vectors.

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

3. Find the area of the triangle with the vertices (0, 0, 0), (2, 0, 1), and (1, 1, 0).

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

4. Calculate (1, 2, 3) × (2, 4, 6) and explain the result.

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.

5. Find the equation of the plane through the points (1, 1, 0), (0, 1, 1), and (1, 0, 1).

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

6. A force of (0, 0, −10) newtons acts at the position (0.5, 0, 0) meters. Find the torque.

τ = 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 Practice

Step 1. Calculate a cross product

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.

Step 2. Check that the result is perpendicular

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.

Step 3. Find an area

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

Step 4. Find the equation of a plane through three points

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

Step 5. Calculate a torque

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.

Quiz

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).

2. Two vectors have the cross product u × v = (2, −1, 4). What is v × u?

3. Find the area of the parallelogram with the sides (3, 0, 0) and (1, 2, 0).

4. What is the cross product of (2, 4, −6) and (1, 2, −3)?

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.

Next: Topic 2.1, Systems and Elimination