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.



Algebraic Definition

The dot product of two vectors a=(a1,a2,,an)\mathbf{a} = (a_1, a_2, \ldots, a_n) and b=(b1,b2,,bn)\mathbf{b} = (b_1, b_2, \ldots, b_n) in Rn\mathbb{R}^n is the scalar obtained by multiplying corresponding components and summing the results:

Dot Product (Algebraic Form)
ab=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) →


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.

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.

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

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; Σ\Sigmasequence notation.
ab\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 aba \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 cvc \cdot \mathbf{v}, optional decoration for scalar multiplication; between vectors, load-bearing. Only the last one changes the species of the result.
Also writtena,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 writtenab\mathbf{a}^{\top}\mathbf{b}, with the sans-serif top glyph; ab\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.
abab|\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 ab\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 abcosθ\|\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(ab)2(aa)(bb)(\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 ab\|\mathbf{a} \cdot \mathbf{b}\| is a species error — the operation already collapsed the vectors; only |\cdot| applies to what remains.

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)
ab=abcosθ\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 ab\mathbf{a} - \mathbf{b}. The law of cosines gives the squared length of the third side:

ab2=a2+b22abcosθ\|\mathbf{a} - \mathbf{b}\|^2 = \|\mathbf{a}\|^2 + \|\mathbf{b}\|^2 - 2\|\mathbf{a}\|\,\|\mathbf{b}\|\cos\theta


Now expand ab2\|\mathbf{a} - \mathbf{b}\|^2 by writing it as (ab)(ab)(\mathbf{a} - \mathbf{b}) \cdot (\mathbf{a} - \mathbf{b}) and distributing. The result is a22(ab)+b2\|\mathbf{a}\|^2 - 2(\mathbf{a} \cdot \mathbf{b}) + \|\mathbf{b}\|^2. Setting the two expressions equal and cancelling the squared norms leaves ab=abcosθ\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.
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


ab=ba\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


a(b+c)=ab+ac\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


(ca)b=c(ab)(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(ab)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}).

Positive Definiteness


aa=a20,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.
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
Commutativityab=ba\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)=ab+ac\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(ab)(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(ab)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}), so it works on either slot.

Conditional1
iv
Positive definitenessaa=a20\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(ab)c(\mathbf{a} \cdot \mathbf{b}) \cdot \mathbf{c}
Ungrammatical rather than false.
Undefined
Fails when
always — not well formed

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

vi
Cancellationab=acb=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 a0\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
ClosureabRn\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
ab=ba\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)=ab+ac\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(ab)(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(ab)\mathbf{a} \cdot (c\mathbf{b}) = c(\mathbf{a} \cdot \mathbf{b}), so it works on either slot.
Positive definitenessConditional
aa=a20\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
(ab)c(\mathbf{a} \cdot \mathbf{b}) \cdot \mathbf{c}
Fails when
always — not well formed
Ungrammatical rather than false. ab\mathbf{a}\cdot\mathbf{b} is a scalar, and a scalar has no dot product with a vector. The nearest meaningful expression is (ab)c(\mathbf{a}\cdot\mathbf{b})\mathbf{c}, which is a scalar multiple.
CancellationFails
ab=acb=c\mathbf{a}\cdot\mathbf{b} = \mathbf{a}\cdot\mathbf{c} \nRightarrow \mathbf{b} = \mathbf{c}
Fails when
always, for a0\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
abRn\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
vv=v2\mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^2
Learn more about this formula: Dot Product Magnitude Relation →


Written out in components, this reads vv=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=vv\|\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=cv\|c\mathbf{v}\| = |c|\,\|\mathbf{v}\| with no extra work. The triangle inequality a+ba+b\|\mathbf{a} + \mathbf{b}\| \leq \|\mathbf{a}\| + \|\mathbf{b}\| follows once we control the size of ab\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 ab=abcosθ\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.

The Angle Between Vectors

Rearranging the geometric formula isolates the angle:

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


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. The cosine of the angle between two vectors depends solely on their directions, not on how long they are.

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.

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 ab\mathbf{a} \cdot \mathbf{b} is determined entirely by cosθ\cos\theta.

When ab>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 angle — they point in broadly the same direction.

When ab=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 ab<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 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.
Sign of a · b Cosine Angle θ Geometric meaning
Positive (> 0) cos θ > 0 θ ∈ (0, π/2) acute 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 angle — vectors point in broadly opposite directions

Orthogonality

Two vectors are orthogonal when their dot product is zero:

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


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 ab=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: 0v=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. Orthogonal vectors are algebraically independent in a strong sense — 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
abab|\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 ab=abcosθ\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 atb2\|\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 abab\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+ba+b\|\mathbf{a} + \mathbf{b}\| \leq \|\mathbf{a}\| + \|\mathbf{b}\| involves controlling the mixed term ab\mathbf{a} \cdot \mathbf{b}, which is exactly the job Cauchy–Schwarz performs.

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
compba=abb\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
projba=abb2b\text{proj}_{\mathbf{b}}\,\mathbf{a} = \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{b}\|^2}\,\mathbf{b}
Learn more about this formula: Vector Projection →


Equivalently, the denominator can be written bb\mathbf{b} \cdot \mathbf{b}. The coefficient abbb\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 compba|\text{comp}_{\mathbf{b}}\,\mathbf{a}|.

Orthogonal Decomposition


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

a=aprojba\mathbf{a}_{\perp} = \mathbf{a} - \text{proj}_{\mathbf{b}}\,\mathbf{a}


Together, the two pieces reconstruct the original:

a=projba+a\mathbf{a} = \text{proj}_{\mathbf{b}}\,\mathbf{a} + \mathbf{a}_{\perp}


The parallel component lies along b\mathbf{b}; the perpendicular component satisfies ab=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×3v1v2v3=proj1×3c·v1c·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 &mdash; 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 &mdash; 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

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 aba \cdot b agree, and from scalar multiplication cvc \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, ab\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 ab\|\mathbf{a} \cdot \mathbf{b}\| is an error: there is no vector left to measure.Read more →