Vectors: Dot & Cross Product
Two vectors in 2D or 3D: their sum and difference, lengths, dot product and the angle between them, the cross product and the area it spans, and the projection of one onto the other, step by step.
Dot or Cross?
The dot product gives a number: how much the two vectors point the same way. It is zero for perpendicular vectors and negative when they point more than 90° apart. Work done by a force, F·s, is a dot product.
The cross product (3D) gives a new vector, perpendicular to both, with a length equal to the area of the parallelogram they span. Its direction follows the right-hand rule. Torque r×F and the magnetic force qv×B are cross products.
The Vectors, Step by Step
a · bStep-by-Step Solution
Key Relations
Perpendicular to both a and b; its length is the area of the parallelogram spanned by them.
The “shadow” of a on the line of b; its signed length is a·b / |b|.
Sources & Verification
- D. C. Lay, S. R. Lay & J. J. McDonald, Linear Algebra and Its Applications, 5th ed., Pearson, 2016 — Sec. 6.1 (inner product, length, orthogonality) and 6.2 (orthogonal projections).
- J. Stewart, Calculus: Early Transcendentals, 8th ed., Cengage, 2015 — Sec. 12.3 (The Dot Product) and 12.4 (The Cross Product).
Frequently Asked Questions
How do you calculate the dot product?
Multiply the matching components and add them up: a·b = aₓbₓ + a_y b_y + a_z b_z. For a = (2, 1, 2) and b = (1, 3, 0): 2·1 + 1·3 + 2·0 = 5. The result is a number, not a vector.
How do you find the angle between two vectors?
Use cos θ = a·b / (|a| |b|). For a = (2, 1, 2) and b = (1, 3, 0): a·b = 5, |a| = 3, |b| = √10, so cos θ = 5 / (3√10) ≈ 0.527 and θ ≈ 58.19°. If the dot product is 0, the vectors are perpendicular.
How do you calculate the cross product?
a × b = (a_y b_z − a_z b_y, a_z bₓ − aₓ b_z, aₓ b_y − a_y bₓ). For a = (2, 1, 2) and b = (1, 3, 0) that is (1·0 − 2·3, 2·1 − 2·0, 2·3 − 1·1) = (−6, 2, 5). The result is a vector perpendicular to both a and b.
What does the length of the cross product mean?
|a × b| is the area of the parallelogram spanned by a and b, and |a| |b| sin θ; half of it is the area of the triangle with sides a and b. For (2, 1, 2) and (1, 3, 0) the area is √65 ≈ 8.06. A zero cross product means the vectors are parallel.
How do you project one vector onto another?
proj_b a = (a·b / |b|²) · b: the shadow of a on the line through b. For a = (2, 3) and b = (4, 0): a·b = 8, |b|² = 16, so the projection is (2, 0). What is left, a − proj = (0, 3), is perpendicular to b.
What is the difference between the dot and the cross product?
The dot product gives a number that measures how much two vectors point the same way (work = force · displacement). The cross product, in 3D, gives a vector perpendicular to both, as long as the parallelogram they span is large (torque = r × F). Dot is zero for perpendicular vectors, cross is zero for parallel ones.