Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Dot Product






The Product That Reveals Angles

The dot product is unlike any operation encountered so far in this section. It takes two vectors and returns not a vector but a single number — a scalar. That number encodes something geometric: the degree to which the two vectors point in the same direction. Through its algebraic definition, the dot product is a straightforward computation — multiply corresponding components and sum. Through its geometric definition, it connects directly to the angle between the vectors, opening the door to orthogonality, projection, and the Cauchy–Schwarz inequality. Both definitions are equivalent, and both are essential.

For step-by-step results on your own numbers, use the dot product calculator on CalculateMatrix.



Algebraic Definition

Nothing so far measures how two vectors relate to each other.
Length measures one vector at a time. Adding and scaling make new vectors. But no operation yet answers the obvious question about two arrows: do they point the same way, at right angles, or against each other — and by how much? A single number that answered it would be worth a great deal.
a = (3, 1) and b = (1, 2) from the origin, 45 degrees apartOθa = (3, 1)b = (1, 2)how much do a and b point the same way?Two vectors and the angle between them
Two arrows from the origin, (3,1)(3, 1) and (1,2)(1, 2), with the angle between them marked.
The definition
The dot product of two vectors a=(a1,…,an)\mathbf{a} = (a_1, \ldots, a_n) and b=(b1,…,bn)\mathbf{b} = (b_1, \ldots, b_n) in Rn\mathbb{R}^n is the scalar obtained by multiplying corresponding components and summing the results:
Dot Product (Algebraic Form)
a⋅b=a1b1+a2b2+⋯+anbn=∑i=1naibi\mathbf{a} \cdot \mathbf{b} = a_1b_1 + a_2b_2 + \cdots + a_nb_n = \sum_{i=1}^{n} a_ib_i
Learn more about this formula: Dot Product (Algebraic Form) →
componentabproduct
first313
second122
suma · b = 5
For a=(3,1)\mathbf{a} = (3, 1) and b=(1,2)\mathbf{b} = (1, 2): multiply down each row, then add the products — 3+2=53 + 2 = 5.
A dot product is a number, not a vector.
The dot product differs fundamentally from vector addition and scalar multiplication. Those operations take vectors and produce vectors. The dot product takes two vectors and collapses them into a single number, discarding the directional structure in favor of a measurement of alignment.
Pitfall: Leaving the products as a vector
Multiplying the components of (3,4)(3, 4) and (1,−2)(1, -2) and writing the answer as (3,−8)(3, -8) stops halfway. The products are added: 3+(−8)=−53 + (-8) = -5, a single number.
The notation uses a centered dot between the two vectors. Other names for the same operation are the inner product and the scalar product — the latter emphasizing that the output is a scalar, not a vector.
On numbers, the rule is the same in every dimension.
This definition works in any dimension. In R2\mathbb{R}^2, the dot product of (3,4)(3, 4) and (1,−2)(1, -2) is 3(1)+4(−2)=−53(1) + 4(-2) = -5. In R5\mathbb{R}^5, the same rule applies with five terms instead of two. The computation is mechanical, but the meaning it carries — revealed by the geometric definition — is what makes the dot product central to the rest of linear algebra.
abproductsa · b
(3, 1)(1, 2)3 + 25
(3, 4)(1, −2)3 + (−8)−5
(1, 2, 3)(4, 0, −1)4 + 0 + (−3)1
(3, 1)(3, 1)9 + 110
Two pairs give positive numbers, one gives a negative number, and a vector dotted with itself gives 1010. What those signs and sizes mean is the next thing to check.
u1×4u1,1u1,2u1,3u1,4,v1×4v1,1v1,2v1,3v1,4=⟨u,v⟩
Products formed, then summed to one number

Each pair of matching components was multiplied and the products were then collapsed into a single running total. The output is a scalar, not a vector, and that one fact is what separates this product from every other operation on this page. Follow the accumulation term by term on the inner product visualizer.

Everything later on this page — angles, orthogonality, projections — is read off that single number.
The definition keeps the promises the opening asked for.
A number that measures how vectors relate should give back length, track the angle, and vanish at right angles. Test all three on the running example.
promisecheck on a = (3, 1), b = (1, 2)kept?
a · a is the squared lengtha · a = 10, and ‖a‖ = √10yes
it reflects the angle5 = √10 · √5 · cos 45°, since √50 · 0.707… = 5yes
perpendicular gives 0(3, 1) · (−1, 3) = −3 + 3 = 0yes
Against a = (3, 1): b at 45 degrees, at a right angle, and pointing awaya = (3, 1)b = (1, 2)45°, acutea · b = 5a = (3, 1)b = (−0.5, 1.5)90°, right anglea · b = 0a = (3, 1)b = (−2, 1)135°, obtusea · b = −5the same rule, a · b, as b turns away from a
The same rule against a=(3,1)\mathbf{a} = (3, 1) as b\mathbf{b} turns: 55 at 45°45°, 00 at a right angle (the square), and negative once b\mathbf{b} points away.
The definition says how to compute; why it measures angle needs a second, geometric description.
Nothing in "multiply and add" mentions angles, yet the checks above came out right. The reason is the geometric definition in the next section, a⋅b=∥a∥∥b∥cos⁡θ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\|\|\mathbf{b}\| \cos\theta, which agrees with this one in every case. The algebraic rule is for computing; the geometric one is for meaning.
To compute the dot product of two specific vectors, use the vector calculator.
The rest of the page gives the notation, the geometric definition and why the two agree, the algebraic properties, the angle between vectors, orthogonality, the Cauchy–Schwarz inequality, and projections.
DownloadPNG2×PDF
1entries
Dot product · as a matrix product

Two vectors, one number

Written as a 1×2 row times a 2×1 column, the dot product of (3,4)(3, 4) and (1,−2)(1, -2) is a matrix product with a single entry: 3(1)+4(−2)=−53(1) + 4(-2) = -5.

§ 1
A1×2·B2×1→AB1×1The inner pair matches, then vanishes. Only the outer numbers survive into the result.
34
A  1×2
·
1−2
B  2×1
=
−5
AB  1×1
How that entry was formed
c11=3·1+4·−2=3−8=−5

Row 1 of A pairs off against column 1 of B, term by term, and the 2 products are summed. The shared length 2 is the inner dimension — it is consumed by the sum and does not appear in the answer.

Multiplications
2m · n · p — one per term of every entry
Additions
1m(n−1)p — one fewer than the terms
Reverse product
2×2defined here, and a different size
Why the result is a scalar

The products are added, not kept. (3,−8)(3, -8) is a stop halfway; the dot product is the single number −5-5, which is why it is also called the scalar product.

Two vectors, one number·/linear-algebra/vectors/dot-productLearn Math Class

Dot Product Notation

Notation

Dot Product Notation

The one dot that is never optional, the matrix spelling of the same number, and how to read a line that mixes every kind of bar.
Bold vectors and components — vector notation; ∥⋅∥\|\cdot\| — norm notation; Σ\Sigma — sequence notation.
a⋅b\mathbf{a} \cdot \mathbf{b}
a dot b
Between two vectors the centered dot is the operation — juxtaposition ab\mathbf{a}\mathbf{b} means nothing here, unlike scalars where abab and a⋅ba \cdot b agree. The output is a scalar; the names, per the Algebraic Definition above, are dot, inner, or scalar product.
CasesThree habitats for one glyph: between scalars, optional; in c⋅vc \cdot \mathbf{v}, optional decoration for scalar multiplication; between vectors, load-bearing. Only the last one changes the species of the result.
Also written⟨a,b⟩\langle \mathbf{a}, \mathbf{b} \rangle — angle brackets, the general inner product's mark, of which the dot is the Rn\mathbb{R}^n special case.
Do not confusea×b\mathbf{a} \times \mathbf{b} — the cross product: different operation, different output species (a vector, and only in R3\mathbb{R}^3). The two multiplication signs of arithmetic become two different operations on vectors.
aTb\mathbf{a}^{T}\mathbf{b}
a transpose b
The matrix spelling of the same number: a row (1×n1 \times n) times a column (n×1n \times 1) is a 1×11 \times 1 matrix — the dot product wearing matrix clothes.
CasesStandard wherever vectors are columns by default — advanced texts, statistics, machine learning. The reversed order abT\mathbf{a}\mathbf{b}^{T} is a different object entirely: an n×nn \times n matrix, the outer product.
Also writtena⊤b\mathbf{a}^{\top}\mathbf{b}, with the sans-serif top glyph; a′b\mathbf{a}'\mathbf{b} in econometrics, where the prime means transpose — colliding with every other job the prime holds.
Do not confuseA power. The TT is a label — transpose — not an exponent; nothing is being raised.
∣a⋅b∣≤∥a∥ ∥b∥|\mathbf{a} \cdot \mathbf{b}| \leq \|\mathbf{a}\|\,\|\mathbf{b}\|
The absolute value of a dot b is at most the product of the norms
Cauchy–Schwarz as a bar-reading exercise: single bars on the left because a⋅b\mathbf{a} \cdot \mathbf{b} is a scalar — ordinary absolute value — and double bars on the right because norms measure vectors. The bar count tracks the species on every line of this page.
CasesThe geometric form ∥a∥∥b∥cos⁡θ\|\mathbf{a}\|\|\mathbf{b}\|\cos\theta reserves θ\theta for the angle between the vectors — the sign verdicts it produces are read off in Sign of the Dot Product below.
Also written(a⋅b)2≤(a⋅a)(b⋅b)(\mathbf{a} \cdot \mathbf{b})^2 \leq (\mathbf{a} \cdot \mathbf{a})(\mathbf{b} \cdot \mathbf{b}) — the squared form, bar-free, common in proofs.
Do not confuseNorm bars on a scalar. Writing ∥a⋅b∥\|\mathbf{a} \cdot \mathbf{b}\| is a species error — the operation already collapsed the vectors; only ∣⋅∣|\cdot| applies to what remains.
DownloadPNG2×PDF
Notation · Cheat sheet
Vector Notation at a Glance
The marks from the notation cards across the vector pages: how each is read and what it means. Every group links to the full card on its page.
Vectors
v,  v→\mathbf{v}, \; \overset{\to}{v}
vector v
Bold in print, an arrow by hand: either marks a vector, not a number.
AB⟶\overset{\longrightarrow}{AB}
vector A B
The vector from point AA to point BB.
i,j,k\mathbf{i}, \mathbf{j}, \mathbf{k}
the standard basis
Unit vectors along the axes; also e1,…,en\mathbf{e}_1, \ldots, \mathbf{e}_n.
Basic operations
(v1,…,vn)(v_1, \ldots, v_n)
v with components v one to v n
The subscript names a slot: v2v_2 is the second component, a number.
Rn\mathbb{R}^n
R n, real n-space
All vectors with nn real components.
Magnitude
∥v∥\|\mathbf{v}\|
the norm of v
Length; two bars for a vector, one for a number.
∥v∥1,  ∥v∥∞\|\mathbf{v}\|_1, \; \|\mathbf{v}\|_\infty
one-norm, infinity-norm
The subscript picks the norm; ∥v∥2\|\mathbf{v}\|_2 is the usual length.
u^\hat{\mathbf{u}}
u hat
A unit vector: ∥u^∥=1\|\hat{\mathbf{u}}\| = 1.
Dot productThis page
a⋅b\mathbf{a} \cdot \mathbf{b}
a dot b
A number from two vectors; ab\mathbf{a}\mathbf{b} with no dot means nothing.
aTb\mathbf{a}^{T}\mathbf{b}
a transpose b
The same number in matrix form: row times column.
Cross product
a×b\mathbf{a} \times \mathbf{b}
a cross b
A vector from two vectors, in R3\mathbb{R}^3 only.
a⋅(b×c)\mathbf{a} \cdot (\mathbf{b} \times \mathbf{c})
a dot, b cross c
The scalar triple product: a signed volume.
Vector properties
a∥b\mathbf{a} \parallel \mathbf{b}
a is parallel to b
One is a scalar multiple of the other: a=cb\mathbf{a} = c\mathbf{b}.
a⊥b\mathbf{a} \perp \mathbf{b}
a is orthogonal to b
Their dot product is 00.
0\mathbf{0}
the zero vector
Parallel and orthogonal to every vector.
Same marks, different job
∣x∣|x| vs ∥v∥\|\mathbf{v}\|One pair of bars for a number, two for the length of a vector.
⋅\cdot and ×\timesBetween numbers, plain multiplication; between vectors, the dot and cross products.
v2v_2 vs v2\mathbf{v}_2Plain: the second component of v\mathbf{v}; bold: the second vector in a list.
Vector Notation at a Glance·/linear-algebra/vectorsLearn Math Class

Geometric Definition

There is a second way to compute the dot product that bypasses components entirely and works directly with lengths and angles. If a\mathbf{a} and b\mathbf{b} are both nonzero and θ\theta denotes the angle they form when drawn from a common point, then:

Dot Product (Geometric Form)
a⋅b=∥a∥ ∥b∥cos⁡θ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta
Learn more about this formula: Dot Product (Geometric Form) →


The right-hand side multiplies the magnitudes of both vectors and adjusts the product by cos⁡θ\cos\theta. That cosine factor does all the interpretive work: it equals 11 when θ=0\theta = 0 (full alignment), drops to 00 at θ=π2\theta = \frac{\pi}{2} (no alignment at all), and reaches −1-1 at θ=π\theta = \pi (complete opposition).

Why does this agree with the component-wise formula? Place a\mathbf{a} and b\mathbf{b} tail to tail and form the triangle completed by a−b\mathbf{a} - \mathbf{b}. The law of cosines gives the squared length of the third side:

Geometric Definition
∥a−b∥2=∥a∥2+∥b∥2−2∥a∥ ∥b∥cos⁡θ\|\mathbf{a} - \mathbf{b}\|^2 = \|\mathbf{a}\|^2 + \|\mathbf{b}\|^2 - 2\|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta

Now expand ∥a−b∥2\|\mathbf{a} - \mathbf{b}\|^2 by writing it as (a−b)⋅(a−b)(\mathbf{a} - \mathbf{b}) \cdot (\mathbf{a} - \mathbf{b}) and distributing. The result is ∥a∥2−2(a⋅b)+∥b∥2\|\mathbf{a}\|^2 - 2(\mathbf{a} \cdot \mathbf{b}) + \|\mathbf{b}\|^2. Setting the two expressions equal and cancelling the squared norms leaves a⋅b=∥a∥ ∥b∥cos⁡θ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta. The component-based sum of products and the length-angle formula are two faces of a single quantity — one assembled from arithmetic on coordinates, the other encoding geometric information about orientation.

Pitfall: Dropping the middle term
Squaring term by term, ∥a−b∥2=∥a∥2+∥b∥2\|\mathbf{a} - \mathbf{b}\|^2 = \|\mathbf{a}\|^2 + \|\mathbf{b}\|^2, loses −2(a⋅b)-2(\mathbf{a} \cdot \mathbf{b}). For a=(4,1)\mathbf{a} = (4, 1) and b=(1,3)\mathbf{b} = (1, 3) it gives 2727, but a−b=(3,−2)\mathbf{a} - \mathbf{b} = (3, -2) has squared length 13=27−2(7)13 = 27 - 2(7).

Distributing (a−b)⋅(a−b)(\mathbf{a} - \mathbf{b}) \cdot (\mathbf{a} - \mathbf{b}) produces four dot products, just as multiplying out (x−y)2(x - y)^2 produces four terms. Two of them are the squared lengths a⋅a\mathbf{a} \cdot \mathbf{a} and b⋅b\mathbf{b} \cdot \mathbf{b}, and the other two, −a⋅b-\mathbf{a} \cdot \mathbf{b} and −b⋅a-\mathbf{b} \cdot \mathbf{a}, merge into one by commutativity. That merged term is the only place where the two vectors meet, and it is the term the law of cosines matches with −2∥a∥ ∥b∥cos⁡θ-2\|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta.
The triangle behind the geometric formula for the dot productOθa = (4, 1), ‖a‖ = √17b = (1, 3)‖b‖ = √10a − blaw of cosines: ‖a − b‖² = ‖a‖² + ‖b‖² − 2‖a‖‖b‖ cos θa · b = 4·1 + 1·3 = 7, and √17 · √10 · cos 57.5° ≈ 7two formulas, one number
Where the cosine comes from

Draw a and b from the same point and join their tips: the third side is a − b, and the angle between a and b is θ. The law of cosines on that triangle, compared with the expansion of (a − b) · (a − b), is exactly the proof in this section. With a = (4, 1) and b = (1, 3), the components give a · b = 7, and the lengths and angle give √17 · √10 · cos 57.5° ≈ 7 — the same number.

The component formula is easy to compute; the geometric one says what the number means.
Definition Formula Most useful when
Algebraic a · b = a₁b₁ + a₂b₂ + ⋯ + aₙbₙ components are known and a numerical answer is wanted; works mechanically in any dimension
Geometric a · b = ‖a‖ ‖b‖ cos θ magnitudes and the angle are known; reveals what the dot product means (alignment) rather than how to compute it

Properties of the Dot Product

The dot product obeys a set of algebraic rules that make it behave predictably in calculations.

Commutativity


Properties of the Dot Product
a⋅b=b⋅a\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}

The order of the two vectors does not matter. This follows directly from commutativity of real number multiplication: aibi=biaia_ib_i = b_ia_i for every component.

Distributivity


Properties of the Dot Product
a⋅(b+c)=a⋅b+a⋅c\mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}

The dot product distributes over vector addition. This allows the dot product of a vector with a sum to be broken apart, a property used constantly when expanding expressions involving multiple vectors.

Scalar Factoring


Properties of the Dot Product
(ca)⋅b=c(a⋅b)(c\mathbf{a}) \cdot \mathbf{b} = c(\mathbf{a} \cdot \mathbf{b})

A scalar multiplied into one of the vectors can be pulled out of the dot product entirely. Combined with commutativity, this also gives a⋅(cb)=c(a⋅b)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}).

Positive Definiteness


Properties of the Dot Product
a⋅a=∥a∥2≥0,with equality if and only if a=0\mathbf{a} \cdot \mathbf{a} = \|\mathbf{a}\|^2 \geq 0, \quad \text{with equality if and only if } \mathbf{a} = \mathbf{0}

The dot product of a vector with itself is the sum of squared components — always non-negative, and zero only for the zero vector. This property ties the dot product directly to the norm and ensures that the geometric notion of length is consistent with the algebraic framework.
DownloadPNG2×PDF
Vectors · dot product

Properties of the dot product

Four laws hold unconditionally and three familiar habits break. Grouping by verdict makes the split structural — you see how much survives before reading a single entry.

07entries
Unconditional3
i
Commutativitya⋅b=b⋅a\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}
Inherited directly from commutativity of real-number multiplication — aibi = biai for every…
Unconditional

Inherited directly from commutativity of real-number multiplication — aibi=biaia_ib_i = b_ia_i for every component. Note this is the opposite of matrix multiplication, where commutativity fails.

ii
Distributivitya⋅(b+c)=a⋅b+a⋅c\mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}
Lets a dot product with a sum be broken apart — used constantly when expanding expressions over…
Unconditional

Lets a dot product with a sum be broken apart — used constantly when expanding expressions over vector addition.

iii
Scalar factoring(ca)⋅b=c(a⋅b)(c\mathbf{a}) \cdot \mathbf{b} = c(\mathbf{a} \cdot \mathbf{b})
A scalar inside the product can be pulled out.
Unconditional

A scalar inside the product can be pulled out. Combined with commutativity this also gives a⋅(cb)=c(a⋅b)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}), so it works on either slot.

Conditional1
iv
Positive definitenessa⋅a=∥a∥2≥0\mathbf{a} \cdot \mathbf{a} = \|\mathbf{a}\|^2 \geq 0
The self-dot product is squared length.
Conditional
Holds when
equality iff a=0\mathbf{a} = \mathbf{0}

The self-dot product is squared length. This is the axiom that ties the dot product to the norm — drop it and lengths stop being meaningful.

Fails or undefined3
v
Associativity(a⋅b)⋅c(\mathbf{a} \cdot \mathbf{b}) \cdot \mathbf{c}
Ungrammatical rather than false.
Undefined
Fails when
always — not well formed

Ungrammatical rather than false. a⋅b\mathbf{a}\cdot\mathbf{b} is a scalar, and a scalar has no dot product with a vector. The nearest meaningful expression is (a⋅b)c(\mathbf{a}\cdot\mathbf{b})\mathbf{c}, which is a scalar multiple.

vi
Cancellationa⋅b=a⋅c⇏b=c\mathbf{a}\cdot\mathbf{b} = \mathbf{a}\cdot\mathbf{c} \nRightarrow \mathbf{b} = \mathbf{c}
The dot product discards whatever is orthogonal to a, so any two vectors agreeing along a are…
Fails
Fails when
always, for a≠0\mathbf{a} \neq \mathbf{0}

The dot product discards whatever is orthogonal to a\mathbf{a}, so any two vectors agreeing along a\mathbf{a} are indistinguishable to it. This is the same collapse that makes projection non-invertible.

Witnessa = (1, 0), b = (2, 5), c = (2, 9)
a · b = a · c = 2, yet b ≠ c
vii
Closurea⋅b∉Rn\mathbf{a} \cdot \mathbf{b} \notin \mathbb{R}^n
Unlike vector addition, the dot product leaves the space.
Fails
Fails when
always — output is a scalar

Unlike vector addition, the dot product leaves the space. That is what makes it a form rather than an operation on vectors, and why it can measure angle and length at all.

Unconditional
Conditional
Fails or undefined
CommutativityUnconditional
a⋅b=b⋅a\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}
Inherited directly from commutativity of real-number multiplication — aibi=biaia_ib_i = b_ia_i for every component. Note this is the opposite of matrix multiplication, where commutativity fails.
DistributivityUnconditional
a⋅(b+c)=a⋅b+a⋅c\mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}
Lets a dot product with a sum be broken apart — used constantly when expanding expressions over vector addition.
Scalar factoringUnconditional
(ca)⋅b=c(a⋅b)(c\mathbf{a}) \cdot \mathbf{b} = c(\mathbf{a} \cdot \mathbf{b})
A scalar inside the product can be pulled out. Combined with commutativity this also gives a⋅(cb)=c(a⋅b)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}), so it works on either slot.
Positive definitenessConditional
a⋅a=∥a∥2≥0\mathbf{a} \cdot \mathbf{a} = \|\mathbf{a}\|^2 \geq 0
Holds when
equality iff a=0\mathbf{a} = \mathbf{0}
The self-dot product is squared length. This is the axiom that ties the dot product to the norm — drop it and lengths stop being meaningful.
AssociativityUndefined
(a⋅b)⋅c(\mathbf{a} \cdot \mathbf{b}) \cdot \mathbf{c}
Fails when
always — not well formed
Ungrammatical rather than false. a⋅b\mathbf{a}\cdot\mathbf{b} is a scalar, and a scalar has no dot product with a vector. The nearest meaningful expression is (a⋅b)c(\mathbf{a}\cdot\mathbf{b})\mathbf{c}, which is a scalar multiple.
CancellationFails
a⋅b=a⋅c⇏b=c\mathbf{a}\cdot\mathbf{b} = \mathbf{a}\cdot\mathbf{c} \nRightarrow \mathbf{b} = \mathbf{c}
Fails when
always, for a≠0\mathbf{a} \neq \mathbf{0}
The dot product discards whatever is orthogonal to a\mathbf{a}, so any two vectors agreeing along a\mathbf{a} are indistinguishable to it. This is the same collapse that makes projection non-invertible.
Witnessa = (1, 0), b = (2, 5), c = (2, 9)
a · b = a · c = 2, yet b ≠ c
ClosureFails
a⋅b∉Rn\mathbf{a} \cdot \mathbf{b} \notin \mathbb{R}^n
Fails when
always — output is a scalar
Unlike vector addition, the dot product leaves the space. That is what makes it a form rather than an operation on vectors, and why it can measure angle and length at all.
The failures all trace to one fact: the dot product returns a scalar, so it leaves the space it operates on. Compare the cross product, which stays inside R3\mathbb{R}^3 and fails associativity for a different reason entirely.
Properties of the dot product·/linear-algebra/vectors/dot-productLearn Math Class

Connection to Magnitude

Positive definiteness reveals that the norm is hiding inside the dot product. When a vector is dotted with itself, the result is exactly the quantity that sits under the square root in the norm formula:

Dot Product Magnitude Relation
v⋅v=∥v∥2\mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^2
Learn more about this formula: Dot Product Magnitude Relation →


Written out in components, this reads v⋅v=v12+v22+⋯+vn2\mathbf{v} \cdot \mathbf{v} = v_1^2 + v_2^2 + \cdots + v_n^2 — a sum of squares. Squared length, in other words, is not a separate concept — it is a dot product in which both slots are filled by the same vector. Flipping this around gives an alternative expression for the norm: ∥v∥=v⋅v\|\mathbf{v}\| = \sqrt{\mathbf{v} \cdot \mathbf{v}}. Rather than defining magnitude independently and then discovering a coincidence, we can view the norm as something the dot product generates.

This observation has practical consequences. Several norm properties that would otherwise demand their own proofs fall out as corollaries of dot product rules. Scalar factoring implies ∥cv∥=∣c∣ ∥v∥\|c\mathbf{v}\| = |c|\,\|\mathbf{v}\| with no extra work. The triangle inequality ∥a+b∥≤∥a∥+∥b∥\|\mathbf{a} + \mathbf{b}\| \leq \|\mathbf{a}\| + \|\mathbf{b}\| follows once we control the size of a⋅b\mathbf{a} \cdot \mathbf{b} through Cauchy–Schwarz — again, a statement framed entirely in dot product language.

The dependence runs both ways. The geometric formula a⋅b=∥a∥ ∥b∥cos⁡θ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta rebuilds the dot product from two norms and an angle. Neither concept stands alone: the dot product encodes magnitude, and magnitude participates in the dot product's geometric interpretation. Separating them into unrelated topics conceals the single algebraic mechanism they both rely on.

Length is not a separate idea: it is the dot product of a vector with itself, under a square root.

The Angle Between Vectors

Rearranging the geometric formula isolates the angle:

Angle Between Vectors
cos⁡θ=a⋅b∥a∥ ∥b∥\cos\theta = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{a}\|\,\|\mathbf{b}\|}
Learn more about this formula: Angle Between Vectors →


Pitfall: Dividing by the squared lengths
For a=(4,1)\mathbf{a} = (4, 1) and b=(1,3)\mathbf{b} = (1, 3), using 1717 and 1010 in the denominator gives cos⁡θ=7170≈0.041\cos\theta = \frac{7}{170} \approx 0.041, so θ≈87.6∘\theta \approx 87.6^\circ. The norms are 17\sqrt{17} and 10\sqrt{10}: cos⁡θ=7170≈0.537\cos\theta = \frac{7}{\sqrt{170}} \approx 0.537 and θ≈57.5∘\theta \approx 57.5^\circ.

This formula is defined only when both vectors are nonzero, since division by zero is undefined. The angle θ\theta lies in the interval [0,π][0, \pi], covering all possibilities from vectors pointing in the same direction (θ=0\theta = 0) to vectors pointing in exactly opposite directions (θ=π\theta = \pi).

The right-hand side is the dot product of the two normalized vectors a^⋅b^\hat{\mathbf{a}} \cdot \hat{\mathbf{b}}. Normalization strips away the magnitudes, leaving only the directional relationship.

COROLLARY
The cosine of the angle between two vectors depends solely on their directions, not on how long they are.

Fact: Methane's bond angle is a dot product
In methane the four hydrogens sit at alternate corners of a cube around the carbon, along (1,1,1)(1, 1, 1) and (1,−1,−1)(1, -1, -1) for example. The dot product is −1-1 and each length is 3\sqrt{3}, so cos⁡θ=−13\cos\theta = -\frac{1}{3} and θ≈109.5∘\theta \approx 109.5^\circ, the bond angle of chemistry books.

In R2\mathbb{R}^2 and R3\mathbb{R}^3, this formula can be verified against the angle measured with a protractor. In higher dimensions, where geometric angles cannot be visualized, the formula serves as the definition of the angle between two vectors — extending a geometric concept into spaces where geometry alone cannot reach.

Even in R3\mathbb{R}^3 the formula often does better than a protractor. Take a cube centred at the origin with corners at (±1,±1,±1)(\pm 1, \pm 1, \pm 1), and draw arrows from the centre to two corners that share no edge, such as (1,1,1)(1, 1, 1) and (1,−1,−1)(1, -1, -1). Measuring the angle between them on a model is awkward; the formula needs only one dot product and two lengths.

Sign of the Dot Product

The sign of the dot product reveals the angular relationship between two vectors without requiring the angle itself to be computed. Since ∥a∥\|\mathbf{a}\| and ∥b∥\|\mathbf{b}\| are both positive for nonzero vectors, the sign of a⋅b\mathbf{a} \cdot \mathbf{b} is determined entirely by cos⁡θ\cos\theta.

When a⋅b>0\mathbf{a} \cdot \mathbf{b} > 0, the cosine is positive, which means θ\theta lies in the interval [0,π2)[0, \frac{\pi}{2}). The vectors form an acute (or zero) angle — they point in broadly the same direction.

When a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0, the cosine is zero, placing θ\theta at exactly π2\frac{\pi}{2}. The vectors are perpendicular — neither has any component in the direction of the other.

When a⋅b<0\mathbf{a} \cdot \mathbf{b} < 0, the cosine is negative, so θ\theta lies in (π2,π](\frac{\pi}{2}, \pi]. The vectors form an obtuse (or straight) angle — they point in broadly opposite directions.

This three-way classification is a fast diagnostic tool. Checking whether a dot product is positive, zero, or negative is often all that is needed to determine the geometric relationship between two vectors — no square roots, no inverse cosines, just the sign of a sum of products.
The sign of the dot product follows the angle: acute, right, obtusea = (3, 0)b = (2, 2)45°, acutea · b = 6a = (3, 0)b = (0, 2.5)90°, right anglea · b = 0a = (3, 0)b = (−2, 2)135°, obtusea · b = −6the sign of a · b tells the angle: acute, right, obtuse
Positive, zero, negative

Keep a = (3, 0) fixed and turn b. At 45° the dot product is 6 — positive, the vectors lean the same way. At 90° it is exactly 0 — perpendicular, neither has any component along the other. At 135° it is −6 — negative, they lean apart. The lengths stay positive throughout, so the sign of a · b is the sign of cos θ.

Reading only the sign is often enough: no square roots and no inverse cosine are needed to tell acute from obtuse.
Sign of a · b Cosine Angle θ Geometric meaning
Positive (> 0) cos θ > 0 θ ∈ [0, π/2) acute (or zero) angle — vectors point in broadly the same direction
Zero (= 0) cos θ = 0 θ = π/2 orthogonal — neither vector has a component along the other
Negative (< 0) cos θ < 0 θ ∈ (π/2, π] obtuse (or straight) angle — vectors point in broadly opposite directions

Orthogonality

Two vectors are orthogonal when their dot product is zero:

Orthogonality Test
a⋅b=0  ⟺  a⊥b\mathbf{a} \cdot \mathbf{b} = 0 \iff \mathbf{a} \perp \mathbf{b}
Learn more about this formula: Orthogonality Test →


Fact: Random arrows are almost perpendicular
Fill two vectors in R10000\mathbb{R}^{10000} with random entries ±1\pm 1: more than 99.9% of the time they meet at between 88∘88^\circ and 92∘92^\circ. The 10,000 products ±1\pm 1 mostly cancel, leaving a dot product typically about 8080 in size (its standard deviation is 100100), while the two lengths multiply to 1000010000.

In R2\mathbb{R}^2 and R3\mathbb{R}^3, orthogonality corresponds to perpendicularity — the vectors meet at a right angle. In Rn\mathbb{R}^n for n>3n > 3, perpendicularity cannot be visualized, but the algebraic condition a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0 still serves as its definition. Orthogonality is the generalization of "right angle" to any number of dimensions.

The zero vector occupies a special position: 0⋅v=0\mathbf{0} \cdot \mathbf{v} = 0 for every vector v\mathbf{v}, so the zero vector is orthogonal to everything. This is a convention that simplifies many statements — without it, theorems about orthogonal sets would need to exclude the zero vector as a separate case.

Orthogonality is far more than a geometric curiosity. Nonzero orthogonal vectors are linearly independent — projecting one onto the other yields zero, meaning neither contributes anything in the direction of the other. This idea scales up: orthogonal bases, orthogonal decompositions, and orthogonal complements form a central thread through the orthogonality section of linear algebra.

The Cauchy–Schwarz Inequality

The dot product of two vectors cannot grow arbitrarily large when their lengths are fixed. Cauchy–Schwarz makes this constraint precise:

Cauchy-Schwarz Inequality
∣a⋅b∣≤∥a∥ ∥b∥|\mathbf{a} \cdot \mathbf{b}| \leq \|\mathbf{a}\|\,\|\mathbf{b}\|
Learn more about this formula: Cauchy-Schwarz Inequality →


The geometric angle formula offers the most transparent explanation. Writing a⋅b=∥a∥ ∥b∥cos⁡θ\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta and noting that ∣cos⁡θ∣|\cos\theta| never surpasses 11, the absolute dot product is automatically bounded by the product of the norms. This ceiling is reached only when cos⁡θ\cos\theta hits ±1\pm 1 — at θ=0\theta = 0 or θ=π\theta = \pi — so equality corresponds to parallel vectors pointing along or against each other.

An entirely coordinate-based proof exists as well, requiring no notion of angle. Consider the expression ∥a−tb∥2\|\mathbf{a} - t\mathbf{b}\|^2 for a variable scalar tt. Because a squared norm is never negative, this expression defines a quadratic in tt with no negative values. A real quadratic that stays non-negative must have a non-positive discriminant, and writing out that discriminant condition yields exactly the Cauchy–Schwarz bound. This argument extends to any setting where an inner product is defined, even when angles lack geometric substance.

The inequality plays a structural role beyond bounding computations. Without it, the angle formula would be ill-posed: feeding a⋅b∥a∥ ∥b∥\frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{a}\|\,\|\mathbf{b}\|} into arccos⁡\arccos requires the fraction to land in [−1,1][-1, 1], and Cauchy–Schwarz is what guarantees this. The norm's triangle inequality likewise depends on it — establishing ∥a+b∥≤∥a∥+∥b∥\|\mathbf{a} + \mathbf{b}\| \leq \|\mathbf{a}\| + \|\mathbf{b}\| involves controlling the mixed term a⋅b\mathbf{a} \cdot \mathbf{b}, which is exactly the job Cauchy–Schwarz performs.

Cauchy–Schwarz is what lets the dot product define angles and keeps lengths obeying the triangle inequality, in any dimension.

Orthogonal Projection

It is frequently necessary to break a vector a\mathbf{a} into two pieces relative to a nonzero vector b\mathbf{b}: one piece aligned with b\mathbf{b} and another at a right angle to it. The dot product supplies the machinery for this decomposition.

Scalar Projection


The signed distance that a\mathbf{a} covers in the direction of b\mathbf{b} is captured by a single number:

Scalar Projection
compb a=a⋅b∥b∥\text{comp}_{\mathbf{b}}\,\mathbf{a} = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{b}\|}
Learn more about this formula: Scalar Projection →


When this quantity comes out positive, a\mathbf{a} tilts toward b\mathbf{b}. A negative result means a\mathbf{a} tilts away. Zero signals complete orthogonality — a\mathbf{a} contributes nothing at all in the direction of b\mathbf{b}.

Vector Projection


To obtain an actual vector rather than a bare number, the scalar projection is re-embedded along b\mathbf{b}:

Vector Projection
projb a=a⋅b∥b∥2 b\text{proj}_{\mathbf{b}}\,\mathbf{a} = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{b}\|^2}\,\mathbf{b}
Learn more about this formula: Vector Projection →


Pitfall: Dividing by the length instead of its square
Projecting a=(4,2)\mathbf{a} = (4, 2) onto b=(1,1)\mathbf{b} = (1, 1) with ∥b∥=2\|\mathbf{b}\| = \sqrt{2} in the denominator gives 62(1,1)≈(4.24,4.24)\frac{6}{\sqrt{2}}(1, 1) \approx (4.24, 4.24), of length 66, longer than a\mathbf{a} itself. With ∥b∥2=2\|\mathbf{b}\|^2 = 2, the projection is 3(1,1)=(3,3)3(1, 1) = (3, 3).

Equivalently, the denominator can be written b⋅b\mathbf{b} \cdot \mathbf{b}. The coefficient a⋅bb⋅b\frac{\mathbf{a} \cdot \mathbf{b}}{\mathbf{b} \cdot \mathbf{b}} rescales b\mathbf{b} so that the output has the appropriate length and orientation. What results is a vector parallel to b\mathbf{b} whose norm equals ∣compb a∣|\text{comp}_{\mathbf{b}}\,\mathbf{a}|.

Orthogonal Decomposition


Removing the projected component from a\mathbf{a} leaves behind the perpendicular part:

Orthogonal Decomposition
a⊥=a−projb a\mathbf{a}_{\perp} = \mathbf{a} - \text{proj}_{\mathbf{b}}\,\mathbf{a}
Learn more about this formula: Orthogonal Decomposition →


Together, the two pieces reconstruct the original:

Orthogonal Projection
a=projb a+a⊥\mathbf{a} = \text{proj}_{\mathbf{b}}\,\mathbf{a} + \mathbf{a}_{\perp}

The parallel component lies along b\mathbf{b}; the perpendicular component satisfies a⊥⋅b=0\mathbf{a}_{\perp} \cdot \mathbf{b} = 0, a fact that follows by substituting the formula and simplifying. These two constituents are geometrically independent — adjusting one leaves the other unchanged, and each accounts for information the other entirely misses.

This two-part split reappears in more sophisticated forms throughout linear algebra. Projection onto a line generalizes to projection onto multi-dimensional subspaces. The Gram–Schmidt procedure repeats the same splitting step iteratively, peeling off parallel components one vector at a time to produce an orthogonal collection. Least-squares fitting identifies the closest approximation inside a subspace by projecting onto it. Each of these techniques, covered in the orthogonality section, traces back to the same principle at work here: partition a vector into what runs along a chosen direction and what runs across it.
Quantity Formula What it represents
Scalar projection compb a (a · b) / ‖b‖ signed length of a's shadow on b; positive when a tilts toward b, negative when away
Vector projection projb a ((a · b) / (b · b)) b = ((a · b) / ‖b‖²) b the shadow as an actual vector, parallel to b, with length equal to |compb a|
Perpendicular component a⊥ a − projb a the part of a orthogonal to b; satisfies a⊥ · b = 0
cu·v/‖v‖²·v1×3v1​v2​v3​=proj1×3c·v1​c·v2​?
The coefficient applied to the direction vector

The scalar computed from the two dot products is being multiplied back onto the direction vector, which is what turns a bare ratio into an actual vector lying along it. The projection is always a multiple of the vector projected onto, never of the one being projected — the picture makes the asymmetry hard to miss. Watch the remainder appear as well on the vector projection visualizer.

Splitting a vector into a part along another and a part perpendicular to it is the move that least squares and Gram–Schmidt both rest on.

Summary: Every Use of the Dot Product

Across the sections above, the dot product appears in seven distinct roles — measuring length, computing angles, testing orthogonality, classifying the angular relationship by sign, bounding products of vectors, and producing two kinds of projection. The table below collects all of these in a single reference, organized around the question each role answers and the formula that does the work. Every entry below is built from the same operation a · b = Σ aibi — the geometric variety on the page comes from how that one number is interpreted and combined with the norm.
Question Use of the dot product Result
What is the length of v? √(v · v) the norm ‖v‖
What angle do a and b make? cos θ = (a · b) / (‖a‖ ‖b‖), then arccos an angle θ in [0, π]
Are a and b orthogonal? check whether a · b = 0 yes / no
Is the angle acute, right, or obtuse? read off the sign of a · b positive / zero / negative → acute / right / obtuse
How big can a · b be given the lengths? |a · b| ≤ ‖a‖ ‖b‖ (Cauchy–Schwarz) a bound; equality only for parallel vectors
What is the signed length of a's shadow on b? (a · b) / ‖b‖ scalar projection compb a
What is a's shadow on b as a vector? ((a · b) / ‖b‖²) b vector projection projb a, parallel to b

Common Pitfalls

Five mistakes come up again and again in dot product work. Four of them are marked where they happen in the sections above; the fifth is the cancellation law that the properties card lists as failing. Here each is worked through in full, with the wrong and the right working side by side.

Leaving the products as a vector

The components are multiplied in pairs, and the list of products is given as the answer, the way vector addition gives a list of sums. The second half of the definition, adding the products, never happens.

Wrong working:
(3,4)⋅(1,−2)=(3⋅1, 4⋅(−2))=(3,−8)(3, 4) \cdot (1, -2) = (3 \cdot 1,\ 4 \cdot (-2)) = (3, -8)


Right working: the products are added.
(3,4)⋅(1,−2)=3(1)+4(−2)=3−8=−5(3, 4) \cdot (1, -2) = 3(1) + 4(-2) = 3 - 8 = -5


Why it happens: vector addition and scalar multiplication both work component by component and return a vector, and the first step of the dot product looks exactly the same.

How to check: the result of a dot product is one number. An answer that still has components is missing the sum.

Dropping the middle term

A squared length of a difference or a sum is expanded as if the square could be taken term by term, and the cross term −2(a⋅b)-2(\mathbf{a} \cdot \mathbf{b}) disappears.

Wrong working, for a=(4,1)\mathbf{a} = (4, 1) and b=(1,3)\mathbf{b} = (1, 3):
∥a−b∥2=∥a∥2+∥b∥2=17+10=27\|\mathbf{a} - \mathbf{b}\|^2 = \|\mathbf{a}\|^2 + \|\mathbf{b}\|^2 = 17 + 10 = 27


Right working: expand the dot product with distributivity and merge the two middle terms by commutativity.
(a−b)⋅(a−b)=∥a∥2−2(a⋅b)+∥b∥2=17−2(7)+10=13(\mathbf{a} - \mathbf{b}) \cdot (\mathbf{a} - \mathbf{b}) = \|\mathbf{a}\|^2 - 2(\mathbf{a} \cdot \mathbf{b}) + \|\mathbf{b}\|^2 = 17 - 2(7) + 10 = 13


Why it happens: the square on ∥a−b∥2\|\mathbf{a} - \mathbf{b}\|^2 looks like the square of a number, and the same slip as (x−y)2=x2−y2(x - y)^2 = x^2 - y^2 carries over to vectors.

How to check: compute the difference first. a−b=(3,−2)\mathbf{a} - \mathbf{b} = (3, -2), and 32+(−2)2=133^2 + (-2)^2 = 13. The term-by-term version is right only when a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0, which is the Pythagorean theorem.

Cancelling a vector from both sides

From a⋅b=a⋅c\mathbf{a} \cdot \mathbf{b} = \mathbf{a} \cdot \mathbf{c} with a≠0\mathbf{a} \neq \mathbf{0}, the vector a\mathbf{a} is divided out to conclude b=c\mathbf{b} = \mathbf{c}, as with numbers.

Wrong working, with the vectors from the properties card:
a=(1,0), b=(2,5), c=(2,9):a⋅b=2=a⋅c  ⟹  b=c\mathbf{a} = (1, 0),\ \mathbf{b} = (2, 5),\ \mathbf{c} = (2, 9): \quad \mathbf{a} \cdot \mathbf{b} = 2 = \mathbf{a} \cdot \mathbf{c} \implies \mathbf{b} = \mathbf{c}

But b≠c\mathbf{b} \neq \mathbf{c}.

Right working: move everything to one side and use distributivity.
a⋅b−a⋅c=a⋅(b−c)=0\mathbf{a} \cdot \mathbf{b} - \mathbf{a} \cdot \mathbf{c} = \mathbf{a} \cdot (\mathbf{b} - \mathbf{c}) = 0

The equation only says that b−c\mathbf{b} - \mathbf{c} is orthogonal to a\mathbf{a}. Here b−c=(0,−4)\mathbf{b} - \mathbf{c} = (0, -4), and (1,0)⋅(0,−4)=0(1, 0) \cdot (0, -4) = 0.

Why it happens: for numbers, ab=acab = ac with a≠0a \neq 0 does give b=cb = c. The dot product has no inverse to divide by, because it only sees the part of b\mathbf{b} that lies along a\mathbf{a}.

How to check: compute b−c\mathbf{b} - \mathbf{c} and dot it with a\mathbf{a}. A result of 00 with b−c≠0\mathbf{b} - \mathbf{c} \neq \mathbf{0} shows that b\mathbf{b} and c\mathbf{c} can differ.

Dividing by the squared lengths

In the angle formula, the denominator is filled with a⋅a\mathbf{a} \cdot \mathbf{a} and b⋅b\mathbf{b} \cdot \mathbf{b}, which are the squared lengths, instead of the lengths themselves.

Wrong working, for a=(4,1)\mathbf{a} = (4, 1) and b=(1,3)\mathbf{b} = (1, 3) with a⋅b=7\mathbf{a} \cdot \mathbf{b} = 7:
cos⁡θ=717⋅10=7170≈0.041,θ≈87.6∘\cos\theta = \frac{7}{17 \cdot 10} = \frac{7}{170} \approx 0.041, \quad \theta \approx 87.6^\circ


Right working: ∥a∥=17\|\mathbf{a}\| = \sqrt{17} and ∥b∥=10\|\mathbf{b}\| = \sqrt{10}.
cos⁡θ=717 10=7170≈0.537,θ≈57.5∘\cos\theta = \frac{7}{\sqrt{17}\,\sqrt{10}} = \frac{7}{\sqrt{170}} \approx 0.537, \quad \theta \approx 57.5^\circ


Why it happens: the values 1717 and 1010 come out of the same kind of sum of products as a⋅b\mathbf{a} \cdot \mathbf{b}, and the square root that turns them into lengths is easy to leave out.

How to check: the angle must not change when a vector is stretched. Doubling a\mathbf{a} to (8,2)(8, 2) gives 1468⋅10≈0.021\frac{14}{68 \cdot 10} \approx 0.021 with the squared lengths, a different angle, while the correct formula gives 14680≈0.537\frac{14}{\sqrt{680}} \approx 0.537 again.

Dividing by the length instead of its square

The vector projection is written with ∥b∥\|\mathbf{b}\| in the denominator, copied from the scalar projection, instead of ∥b∥2\|\mathbf{b}\|^2.

Wrong working, for a=(4,2)\mathbf{a} = (4, 2) and b=(1,1)\mathbf{b} = (1, 1) with a⋅b=6\mathbf{a} \cdot \mathbf{b} = 6:
a⋅b∥b∥ b=62(1,1)≈(4.24,4.24)\frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{b}\|}\,\mathbf{b} = \frac{6}{\sqrt{2}}(1, 1) \approx (4.24, 4.24)


Right working: ∥b∥2=b⋅b=2\|\mathbf{b}\|^2 = \mathbf{b} \cdot \mathbf{b} = 2.
projb a=62(1,1)=(3,3)\text{proj}_{\mathbf{b}}\,\mathbf{a} = \frac{6}{2}(1, 1) = (3, 3)


Why it happens: the scalar projection divides by ∥b∥\|\mathbf{b}\| once, and the vector projection looks like the same fraction placed in front of b\mathbf{b}. But b\mathbf{b} is not a unit vector, so a second division by ∥b∥\|\mathbf{b}\| is needed to turn it into one.

How to check: a projection is never longer than the vector projected. The wrong answer has length 66, more than ∥a∥=20≈4.47\|\mathbf{a}\| = \sqrt{20} \approx 4.47. Also, a\mathbf{a} minus its projection must be orthogonal to b\mathbf{b}: (4,2)−(3,3)=(1,−1)(4, 2) - (3, 3) = (1, -1), and (1,−1)⋅(1,1)=0(1, -1) \cdot (1, 1) = 0.

Dot Product FAQ

Can you write ab\mathbf{a}\mathbf{b} without the dot?

+
No. Between two vectors the dot is the operation itself, so juxtaposition means nothing at all. That differs from scalars, where abab and a⋅ba \cdot b agree, and from scalar multiplication c⋅vc \cdot \mathbf{v}, where the dot is decoration. Only between two vectors does the mark carry the operation.Read more →

In aTb\mathbf{a}^{T}\mathbf{b}, is the TT an exponent?

+
No, it is a label meaning transpose, so nothing is raised to a power. The expression is the dot product written in matrix clothing: a 1×n1 \times n row times an n×1n \times 1 column gives a single number. Reversing it to abT\mathbf{a}\mathbf{b}^{T} produces something else entirely, an n×nn \times n outer product.Read more →

Why does the Cauchy–Schwarz inequality mix single and double bars?

+
Because the two sides measure different species. On the left, a⋅b\mathbf{a} \cdot \mathbf{b} has already collapsed to a scalar, so it takes ordinary absolute value bars. On the right sit two vectors, which need norm bars. Writing ∥a⋅b∥\|\mathbf{a} \cdot \mathbf{b}\| is an error: there is no vector left to measure.Read more →

If a⋅b=a⋅c\mathbf{a} \cdot \mathbf{b} = \mathbf{a} \cdot \mathbf{c}, does b=c\mathbf{b} = \mathbf{c}?

+
No, not even when a≠0\mathbf{a} \neq \mathbf{0}. Moving everything to one side gives a⋅(b−c)=0\mathbf{a} \cdot (\mathbf{b} - \mathbf{c}) = 0, which only says that b−c\mathbf{b} - \mathbf{c} is orthogonal to a\mathbf{a}. With a=(1,0)\mathbf{a} = (1, 0), b=(2,5)\mathbf{b} = (2, 5) and c=(2,9)\mathbf{c} = (2, 9), both dot products equal 22, yet b≠c\mathbf{b} \neq \mathbf{c}. The dot product sees only the part of a vector that lies along a\mathbf{a}, so there is nothing to divide by.Read more →

Is the dot product associative?

+
No, and the question cannot even be posed: (a⋅b)⋅c(\mathbf{a} \cdot \mathbf{b}) \cdot \mathbf{c} is not well formed. The first product a⋅b\mathbf{a} \cdot \mathbf{b} is already a scalar, and a scalar has no dot product with a vector. The nearest meaningful expression is (a⋅b)c(\mathbf{a} \cdot \mathbf{b})\mathbf{c}, a scalar multiple of c\mathbf{c}, and in general it differs from a(b⋅c)\mathbf{a}(\mathbf{b} \cdot \mathbf{c}), which points along a\mathbf{a}.Read more →

Is ∥a−b∥2\|\mathbf{a} - \mathbf{b}\|^2 equal to ∥a∥2+∥b∥2\|\mathbf{a}\|^2 + \|\mathbf{b}\|^2?

+
Only when a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0, which is the Pythagorean theorem. In general, expanding (a−b)⋅(a−b)(\mathbf{a} - \mathbf{b}) \cdot (\mathbf{a} - \mathbf{b}) leaves a middle term: ∥a−b∥2=∥a∥2−2(a⋅b)+∥b∥2\|\mathbf{a} - \mathbf{b}\|^2 = \|\mathbf{a}\|^2 - 2(\mathbf{a} \cdot \mathbf{b}) + \|\mathbf{b}\|^2. For a=(4,1)\mathbf{a} = (4, 1) and b=(1,3)\mathbf{b} = (1, 3) the shortcut gives 17+10=2717 + 10 = 27, but a−b=(3,−2)\mathbf{a} - \mathbf{b} = (3, -2) has squared length 13=27−2(7)13 = 27 - 2(7).Read more →

Why are random vectors in high dimensions almost perpendicular?

+
Because their dot product grows far more slowly than their lengths. Fill two vectors in R10000\mathbb{R}^{10000} with random entries ±1\pm 1: the 1000010000 products ±1\pm 1 mostly cancel, leaving a dot product typically about 8080 in size (its standard deviation is 100100), while the two lengths multiply to 1000010000. So cos⁡θ\cos\theta sits near 0.010.01, and more than 99.9% of such pairs meet at between 88∘88^\circ and 92∘92^\circ.Read more →