The Dot Product as a Projection

April 12, 2026

Problem

Visualize how A · B = |A| |B| cos(θ) represents the projection of one vector onto another.

Explanation

The dot product of two vectors has two equivalent definitions, and reconciling them is one of the most beautiful results in vector algebra.

Algebraic: AB=AxBx+AyBy\vec A\cdot\vec B = A_x B_x + A_y B_y

Geometric: AB=ABcosθ\vec A\cdot\vec B = |\vec A|\,|\vec B|\cos\theta

The geometric form has a wonderful interpretation: Bcosθ|\vec B|\cos\theta is the length of the projection of B\vec B onto A\vec A (i.e., the "shadow" of B\vec B on the line through A\vec A). Multiplied by A|\vec A|, the dot product measures how much B\vec B goes in the direction of A\vec A.

Step-by-Step Solution

Given: A=(3,4)\vec A = (3, 4) and B=(2,1)\vec B = (2, 1).

Find: The dot product, the angle between them, and the projection of B\vec B onto A\vec A.


Step 1 — Compute the dot product algebraically.

AB=(3)(2)+(4)(1)=6+4=10\vec A\cdot\vec B = (3)(2) + (4)(1) = 6 + 4 = 10

Step 2 — Compute the magnitudes.

A=32+42=25=5|\vec A| = \sqrt{3^{2} + 4^{2}} = \sqrt{25} = 5

B=22+12=52.2361|\vec B| = \sqrt{2^{2} + 1^{2}} = \sqrt{5} \approx 2.2361

Step 3 — Use the geometric form to find the angle.

cosθ=ABAB=1055=1055=250.8944\cos\theta = \dfrac{\vec A\cdot\vec B}{|\vec A|\,|\vec B|} = \dfrac{10}{5 \cdot \sqrt{5}} = \dfrac{10}{5\sqrt{5}} = \dfrac{2}{\sqrt{5}} \approx 0.8944

θ=arccos(0.8944)26.57°\theta = \arccos(0.8944) \approx 26.57°

Step 4 — Compute the projection of B\vec B onto A\vec A.

The scalar projection is:

projAB=Bcosθ=525=2\text{proj}_{\vec A}\vec B = |\vec B|\cos\theta = \sqrt{5} \cdot \dfrac{2}{\sqrt{5}} = 2

So the "shadow" of B\vec B on the line through A\vec A has length 2.

Multiplying by the unit vector A^=A/A=(3/5,4/5)=(0.6,0.8)\hat A = \vec A/|\vec A| = (3/5, 4/5) = (0.6, 0.8) gives the vector projection:

projAB=2(0.6,0.8)=(1.2,1.6)\vec{\text{proj}}_{\vec A}\vec B = 2 \cdot (0.6, 0.8) = (1.2, 1.6)

Step 5 — Verify the equivalence of the two formulas.

ABcosθ=550.8944=52=10    |\vec A|\,|\vec B|\cos\theta = 5 \cdot \sqrt{5} \cdot 0.8944 = 5 \cdot 2 = 10 \;\;\checkmark

Both give the same answer: AB=10\vec A\cdot\vec B = 10.

Step 6 — Special cases.

  • AB=0\vec A\cdot\vec B = 0θ=90°\theta = 90° → vectors are perpendicular.
  • AB>0\vec A\cdot\vec B > 0θ<90°\theta < 90° → vectors point in "similar" directions.
  • AB<0\vec A\cdot\vec B < 0θ>90°\theta > 90° → vectors point in "opposite" directions.

Answer:

  AB=10,θ26.57°,projAB=(1.2,1.6)  \boxed{\;\vec A\cdot\vec B = 10,\quad \theta \approx 26.57°,\quad \vec{\text{proj}}_{\vec A}\vec B = (1.2,\, 1.6)\;}

The dot product 10 is the product of A=5|\vec A| = 5 and the scalar projection of B\vec B onto A\vec A (which is 2). Geometrically, the dot product measures how much B\vec B extends in the direction of A\vec A.

Try It

  • Adjust the components of B to see how the projection changes.
  • When the angle reaches 90°, the dot product hits zero (perpendicular vectors).
  • When B\vec B aligns perfectly with A\vec A, the projection equals B|\vec B| and the dot product is maximum.
  • The HUD shows both forms of the dot product and confirms they always agree.

Interactive Visualization

Parameters

2.00
1.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
The Dot Product as a Projection | MathSpin