Vector Dot Product & Projection
The dot product combines two vectors into a single number (scalar) measuring how much they point in the same direction: . Projection uses it to find the "shadow" one vector casts on another. Used everywhere in physics (work, flux), computer graphics, and machine learning. Foundational since the late 1800s (Gibbs, Heaviside).
The dot product answers one question: "How much do these two vectors agree in direction?" When they point the same way, it is large and positive; when perpendicular, it is exactly zero; when opposed, it is negative. This single number unlocks angles, perpendicularity tests, work in physics, and the decomposition of any vector into useful directions.
Formal Statement
For vectors and in or , the dot product is a scalar defined geometrically by:
Derivation hint: This is the definition; is the angle between the two vectors when placed tail-to-tail, with . Equivalently, in component form (with , ):
Derivation hint: Expand using distributivity over the standard basis and the facts , , etc.
Symbols: is the magnitude (length) of ; is the angle between them; are the scalar components of .
The length of a vector is the square root of its dot product with itself:
Derivation hint: Set in equation [1]; since , , giving .
Solving equation [1] for gives a formula for the angle:
Derivation hint: Divide both sides of [1] by (valid for nonzero vectors).
The scalar projection of onto (the signed length of 's shadow along ) is:
Derivation hint: From [1], ; the shadow length is , so divide by . The vector projection of onto (the shadow as an actual vector) is:
Derivation hint: Multiply the scalar projection [5] by the unit vector to give it the direction of .
For vectors and scalar :
Derivation hint: Component products commute in [2].
Derivation hint: Expand using [2] and the distributivity of ordinary multiplication.
Derivation hint: Factor from each term in [2].
Two nonzero vectors are orthogonal (perpendicular) if and only if their dot product is zero:
Derivation hint: In [1], with nonzero magnitudes, forces , i.e. .
Why It Holds / Derivation
We show using the Law of Cosines.
Step 1. Place and tail-to-tail. The vector from the tip of to the tip of is . These three vectors form a triangle with sides , , and , with angle between the first two.
Step 2. Apply the Law of Cosines to that triangle:
Derivation hint: Standard Law of Cosines with the included angle .
Step 3. Expand the left side using components. With :
Derivation hint: Expand each squared binomial and sum.
Step 4. Recognize and . Substitute [12] into [11]:
Step 5. Cancel from both sides and divide by :
This is exactly equations [2] = [1].
∎The American physicist and mathematician Gibbs, professor at Yale, developed modern vector analysis in the 1880s as a streamlined alternative to Hamilton's quaternions. In his lecture notes (later published as Vector Analysis, 1901, co-authored with E. B. Wilson) he introduced the now-standard dot and cross product notation. Working independently, the British engineer Oliver Heaviside reached very similar formulations. Their notation triumphed because it cleanly separated the two natural products of vectors — the scalar dot product and the vector cross product — into distinct, physically meaningful operations.
Building Intuition
Think of the dot product as measuring shadow length times length. If the sun is directly above the direction of , then casts a shadow onto the line of . The length of that shadow is . Multiply by and you get the dot product. Three signposts make the sign intuitive:
- Same general direction (): shadow points along , dot product positive.
- Perpendicular (): no shadow, dot product zero.
- Opposing directions (): shadow points backward, dot product negative.
Equation [3], , reveals that the dot product secretly contains the Pythagorean theorem — distance is just a dot product in disguise.
Worked Examples
Given: and . Find the angle between them.
Step 1 — Dot product (eq [2]):
Step 2 — Magnitudes (eq [3]):
Step 3 — Cosine (eq [4]):
Step 4 — Angle:
Given: A constant force newtons acts on an object as it moves through displacement metres. Find the work done.
Step 1 — Work is the dot product of force and displacement:
Step 2 — Compute (eq [2]):
Step 3 — Interpret: Only the force component along the displacement (the -direction) does work; the vertical component is perpendicular to motion and does none.
Given: Project onto .
Step 1 — Numerator (eq [2]): .
Step 2 — Denominator: .
Step 3 — Vector projection (eq [6]):
The shadow of on the -axis has length 4 — exactly the -component of , as expected.
Common Misconceptions
The result of a dot product is always a scalar (a single number), never a vector. Writing "" is wrong. Do not confuse the dot product with the cross product, which yields a vector. Also note: there is no "vector division," and expressions like are meaningless.
While the dot product is commutative (), projection is not symmetric. The scalar projection divides by , whereas projecting the other way divides by . They are generally different lengths in different directions.
One might think implies one of the vectors is zero (as with ordinary numbers, where forces or ). False. Take and . Then , yet both vectors are nonzero. The dot product vanishes simply because they are perpendicular — the "zero-product property" does not transfer to vectors.
Connections
The dot product sits at the centre of a web of related ideas. It is one of two fundamental products of vectors; the other, the Cross Product, produces a perpendicular vector and measures area rather than alignment. The angle formula [4] depends on the Law of Cosines, and the magnitude formula [3] is a restatement of the Pythagorean Theorem in vector form. Projection generalizes to the Gram-Schmidt Process for building orthogonal bases, and the abstract version of the dot product is the Inner Product Space, which underlies advanced linear algebra and quantum mechanics. The concept of Orthogonality — defined by a zero dot product — is one of the most reused ideas in all of mathematics.
Real-World Applications
Historical Development
Subtleties & Limits
The dot product as taught here lives comfortably in Euclidean space, but its generalizations raise deep questions. In special relativity, the relevant "inner product" (the Minkowski metric) uses a minus sign — — so a nonzero vector can have zero length (a "null" or light-like vector), breaking the comforting rule that is always positive. More abstractly, which spaces admit an inner product compatible with their structure, and how inner products interact with curvature (in Riemannian geometry), remains an active area where the simple high-school dot product becomes a varying field of metrics. Even the question of how to best define "angle" and "projection" in high-dimensional data spaces — where intuition fails and most random vectors are nearly orthogonal — drives ongoing research in data science.
See Also
Cross Product · Inner Product Space · Orthogonality · Law of Cosines · Vectors and Components · Cosine Similarity · Gram-Schmidt Process