Skip to main content

The scalar (dot) product: component formula, geometric formula, angle between vectors and orthogonality

Syllabus dot point

“Compute the scalar product of two vectors in component or geometric form and use it to find the angle between vectors and test orthogonality”

HSCMaths Extension 1Vectors (ME-V1)13 min read

Quick answer

The scalar (dot) product is a⋅b=a1b1+a2b2=∣a∣ ∣b∣cos⁡θ\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 = |\mathbf{a}|\,|\mathbf{b}| \cos \theta, a number whose sign tells you whether the angle is acute, right or obtuse. Perpendicular vectors satisfy a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0, and the angle between vectors is θ=arccos⁡ ⁣(a⋅b∣a∣ ∣b∣)\theta = \arccos\!\big(\frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}\big).

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions

What this dot point is asking

NESA wants you to compute the scalar (dot) product of two vectors using either the component formula or the geometric formula, understand it as a measure of how much two vectors point the same way, and use it for the two jobs it does in this course: finding the angle between vectors, and testing whether they are perpendicular. The dot product is also the engine of the next dot point, projection, and shows up constantly in geometric proofs, so it is worth knowing cold.

The answer

For two-dimensional vectors a=(a1,a2)\mathbf{a} = (a_1, a_2) and b=(b1,b2)\mathbf{b} = (b_1, b_2) there are two formulas for the same number.

Component form (the one you compute with):

a⋅b=a1b1+a2b2.\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2.

Geometric form (the one that gives it meaning):

a⋅b=∣a∣ ∣b∣cos⁡θ,0≤θ≤π,\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}|\,|\mathbf{b}| \cos \theta, \qquad 0 \le \theta \le \pi,

where θ\theta is the angle between the two arrows when their tails are placed together.

The dot product and the angle between two vectors Vectors a and b drawn from a common point O with the angle theta between them marked. The dot product equals the magnitude of a times the magnitude of b times cosine theta. a b θ O a . b = |a| |b| cos θ

Why the two formulas agree

This is worth seeing once. Apply the cosine rule to the triangle whose sides are a\mathbf{a}, b\mathbf{b} and a−b\mathbf{a} - \mathbf{b} (the side opposite the angle θ\theta):

∣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 the left side in components: ∣a−b∣2=(a1−b1)2+(a2−b2)2=∣a∣2+∣b∣2−2(a1b1+a2b2)|\mathbf{a} - \mathbf{b}|^2 = (a_1 - b_1)^2 + (a_2 - b_2)^2 = |\mathbf{a}|^2 + |\mathbf{b}|^2 - 2(a_1 b_1 + a_2 b_2). Comparing the two right-hand sides, the ∣a∣2+∣b∣2|\mathbf{a}|^2 + |\mathbf{b}|^2 terms cancel and we are left with a1b1+a2b2=∣a∣ ∣b∣cos⁡θa_1 b_1 + a_2 b_2 = |\mathbf{a}|\,|\mathbf{b}|\cos\theta. The component formula and the geometric formula are the same number, which is exactly why one can be used to compute the other.

Key fact

a⋅b=a1b1+a2b2=∣a∣ ∣b∣cos⁡θ.\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 = |\mathbf{a}|\,|\mathbf{b}| \cos \theta.

The result is a scalar (a number), not a vector. Three consequences carry most of the marks in this topic: a⋅a=∣a∣2\mathbf{a} \cdot \mathbf{a} = |\mathbf{a}|^2 (a vector dotted with itself is its length squared); the angle satisfies cos⁡θ=a⋅b∣a∣ ∣b∣\cos\theta = \dfrac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}; and two non-zero vectors are perpendicular if and only if a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0.

The sign of the dot product tells you the angle

Because ∣a∣|\mathbf{a}| and ∣b∣|\mathbf{b}| are positive, the sign of a⋅b\mathbf{a} \cdot \mathbf{b} matches the sign of cos⁡θ\cos\theta. So without computing the angle at all you can read off whether it is acute, right or obtuse.

Acute angle: the dot product is positive. The vectors broadly agree in direction, cos⁡θ>0\cos\theta > 0, so a⋅b>0\mathbf{a} \cdot \mathbf{b} > 0.

Acute angle: positive dot product Two vectors a and b from a point with a small acute angle theta between them; the dot product is positive. a b θ θ < 90°: a . b > 0

Right angle: the dot product is zero. Perpendicular vectors have cos⁡90∘=0\cos 90^\circ = 0, so a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0. This is the orthogonality test.

Right angle: zero dot product Vectors a and b perpendicular, with a small square marking the right angle; the dot product is zero. a b θ = 90°: a . b = 0

Obtuse angle: the dot product is negative. The vectors broadly oppose, cos⁡θ<0\cos\theta < 0, so a⋅b<0\mathbf{a} \cdot \mathbf{b} < 0.

Obtuse angle: negative dot product Two vectors a and b from a point with a large obtuse angle theta between them; the dot product is negative. a b θ θ > 90°: a . b < 0

Finding the angle between two vectors

Rearranging the geometric formula gives the angle directly:

cos⁡θ=a⋅b∣a∣ ∣b∣,θ=arccos⁡ ⁣(a⋅b∣a∣ ∣b∣).\cos \theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}, \qquad \theta = \arccos\!\left(\frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}\right).

This works for any two non-zero vectors. Because 0≤θ≤π0 \le \theta \le \pi, arccos⁡\arccos returns exactly the right range (no quadrant ambiguity to resolve), which is one reason the dot product is the standard tool for angles between vectors.

Properties (bilinearity)

The scalar product behaves like ordinary multiplication, with one caveat: the output is a scalar. It is commutative, a⋅b=b⋅a\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}, and bilinear (linear in each slot):

a⋅(b+c)=a⋅b+a⋅c,λ(a⋅b)=(λa)⋅b=a⋅(λb).\mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}, \qquad \lambda(\mathbf{a} \cdot \mathbf{b}) = (\lambda\mathbf{a}) \cdot \mathbf{b} = \mathbf{a} \cdot (\lambda\mathbf{b}).

These rules let you expand brackets exactly as in algebra. In particular, since a⋅a=∣a∣2\mathbf{a} \cdot \mathbf{a} = |\mathbf{a}|^2,

∣a+b∣2=(a+b)⋅(a+b)=∣a∣2+2 a⋅b+∣b∣2,|\mathbf{a} + \mathbf{b}|^2 = (\mathbf{a} + \mathbf{b}) \cdot (\mathbf{a} + \mathbf{b}) = |\mathbf{a}|^2 + 2\,\mathbf{a} \cdot \mathbf{b} + |\mathbf{b}|^2,

which is the vector analogue of (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 and a workhorse in proofs.

How exam questions ask about the scalar product

  • "Show that a\mathbf{a} and b\mathbf{b} are perpendicular" or "... orthogonal": compute a⋅b\mathbf{a} \cdot \mathbf{b} and show it is 00.
  • "Find the value of kk so that a\mathbf{a} and b\mathbf{b} are perpendicular": set a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0 and solve for kk.
  • "Find the angle between ...": use θ=arccos⁡ ⁣(a⋅b∣a∣∣b∣)\theta = \arccos\!\big(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|}\big), then round if asked.
  • "Find a vector perpendicular to a\mathbf{a}": in 2D, swap the components and negate one, (a1,a2)→(−a2,a1)(a_1, a_2) \to (-a_2, a_1); check with a dot product.
  • "Hence find ∣a+b∣|\mathbf{a} + \mathbf{b}| given ∣a∣|\mathbf{a}|, ∣b∣|\mathbf{b}| and the angle": expand ∣a+b∣2=∣a∣2+2a⋅b+∣b∣2|\mathbf{a} + \mathbf{b}|^2 = |\mathbf{a}|^2 + 2\mathbf{a}\cdot\mathbf{b} + |\mathbf{b}|^2 with a⋅b=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta.
  • "a⋅b=…\mathbf{a} \cdot \mathbf{b} = \ldots and a⋅c=…\mathbf{a} \cdot \mathbf{c} = \ldots; find a⋅(pb+qc)\mathbf{a} \cdot (p\mathbf{b} + q\mathbf{c})": a bilinearity drill, distribute the dot product.
Exam technique

Decide first which formula the question hands you. If you are given components, use a1b1+a2b2a_1 b_1 + a_2 b_2; if you are given magnitudes and an angle (or asked for the angle), use ∣a∣∣b∣cos⁡θ|\mathbf{a}||\mathbf{b}|\cos\theta. For a "perpendicular" question, do not compute the angle and check it is 90∘90^\circ, just write "a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0" and solve, it is faster and is the response markers expect. For an angle, keep the dot product and the magnitudes exact, substitute into cos⁡θ\cos\theta, and only round at the very last line (state the degree of accuracy asked for, and include the degree or radian symbol). Sign-check obtuse answers: a negative dot product must give an angle bigger than 90∘90^\circ.

Worked example

Apply the component formula directly

Compute (3,−1)⋅(4,2)(3, -1)\cdot(4, 2). Multiply corresponding components and add:

3⋅4+(−1)⋅2=12−2=10.3 \cdot 4 + (-1) \cdot 2 = 12 - 2 = 10.

The result is a positive scalar, so the angle between these two vectors is acute.

Test orthogonality using the zero-dot-product criterion

Are (1,2)(1, 2) and (4,−2)(4, -2) perpendicular? The quickest test is whether the dot product is zero:

1⋅4+2⋅(−2)=4−4=0.1 \cdot 4 + 2 \cdot (-2) = 4 - 4 = 0.

Since the dot product is zero, the vectors are perpendicular.

Find an unknown so that two vectors are perpendicular

Find kk so that a=(2,3)\mathbf{a} = (2, 3) and b=(−1,k)\mathbf{b} = (-1, k) are perpendicular. Set the dot product to zero and solve:

a⋅b=(2)(−1)+(3)(k)=−2+3k=0⟹k=23.\mathbf{a}\cdot\mathbf{b} = (2)(-1) + (3)(k) = -2 + 3k = 0 \quad\Longrightarrow\quad k = \tfrac{2}{3}.

Find the angle using the geometric formula

Find the angle between (2,0)(2, 0) and (1,1)(1, 1). Compute the dot product and the two magnitudes, then apply the angle formula:

a⋅b=2⋅1+0⋅1=2,∣a∣=2,∣b∣=2.\mathbf{a}\cdot\mathbf{b} = 2\cdot 1 + 0\cdot 1 = 2, \qquad |\mathbf{a}| = 2, \qquad |\mathbf{b}| = \sqrt{2}.

cos⁡θ=222=12,θ=45∘.\cos\theta = \frac{2}{2\sqrt{2}} = \frac{1}{\sqrt{2}}, \qquad \theta = 45^\circ.

Construct a perpendicular vector by inspection

Find a non-zero vector perpendicular to (3,4)(3, 4). For a 2D vector (a,b)(a, b), the vector (−b,a)(-b, a) is always perpendicular (a 90∘90^\circ rotation). Here that gives (−4,3)(-4, 3), and equally (4,−3)(4, -3):

3⋅4+4⋅(−3)=12−12=0.3 \cdot 4 + 4 \cdot (-3) = 12 - 12 = 0.

Exploit bilinearity to simplify a computation

If a⋅b=5\mathbf{a}\cdot\mathbf{b} = 5 and a⋅c=−2\mathbf{a}\cdot\mathbf{c} = -2, find a⋅(2b−3c)\mathbf{a}\cdot(2\mathbf{b} - 3\mathbf{c}). The dot product is linear in each slot, so it distributes like ordinary multiplication:

a⋅(2b−3c)=2(a⋅b)−3(a⋅c)=2(5)−3(−2)=10+6=16.\mathbf{a}\cdot(2\mathbf{b} - 3\mathbf{c}) = 2(\mathbf{a}\cdot\mathbf{b}) - 3(\mathbf{a}\cdot\mathbf{c}) = 2(5) - 3(-2) = 10 + 6 = 16.

Use the expansion of a squared magnitude to find a length

If ∣a∣=3|\mathbf{a}| = 3, ∣b∣=4|\mathbf{b}| = 4, and a⋅b=6\mathbf{a}\cdot\mathbf{b} = 6, find ∣a+b∣|\mathbf{a}+\mathbf{b}|. Expand the squared magnitude using the dot product, exactly as one expands (a+b)2(a+b)^2:

∣a+b∣2=∣a∣2+2 a⋅b+∣b∣2=9+12+16=37,∣a+b∣=37.|\mathbf{a}+\mathbf{b}|^2 = |\mathbf{a}|^2 + 2\,\mathbf{a}\cdot\mathbf{b} + |\mathbf{b}|^2 = 9 + 12 + 16 = 37, \qquad |\mathbf{a}+\mathbf{b}| = \sqrt{37}.

Common traps
Confusing scalar product with a vector product
The scalar (dot) product returns a number. There is no cross product in HSC Extension 1; do not produce a vector from a⋅b\mathbf{a} \cdot \mathbf{b}.
Squaring without expanding
∣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, just like (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2. You cannot square term by term.
Rounding too early
Keep a⋅b\mathbf{a}\cdot\mathbf{b} and the magnitudes exact, then round once at the end. Rounding the cosine first throws off the final degree.
Forgetting bilinearity
a⋅(b+c)=a⋅b+a⋅c\mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}; you must distribute, you cannot "factor out" a vector the way you factor a number.
Angle outside [0,π][0, \pi]
The angle between two vectors is conventionally in [0,180∘][0, 180^\circ], which is exactly the range arccos⁡\arccos returns. A negative cosine gives an obtuse angle, not a reflex one.

Exam-style questions

Questions in the style of NESA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

HSC-style3 marks
Vectors a=(2,3)\mathbf{a} = (2, 3) and b=(−1,k)\mathbf{b} = (-1, k) are perpendicular. Find kk.
Show worked answer →

Perpendicular vectors satisfy a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0.

Compute: a⋅b=(2)(−1)+(3)(k)=−2+3k\mathbf{a} \cdot \mathbf{b} = (2)(-1) + (3)(k) = -2 + 3 k.

Set to zero: −2+3k=0-2 + 3 k = 0, so k=23k = \frac{2}{3}.

Markers reward stating the orthogonality condition, the dot product computation, and the algebra.

HSC-style4 marks
Find the angle between the vectors a=(1,2)\mathbf{a} = (1, 2) and b=(3,−1)\mathbf{b} = (3, -1) in degrees to the nearest degree.
Show worked answer →

a⋅b=(1)(3)+(2)(−1)=3−2=1\mathbf{a} \cdot \mathbf{b} = (1)(3) + (2)(-1) = 3 - 2 = 1.

∣a∣=1+4=5|\mathbf{a}| = \sqrt{1 + 4} = \sqrt{5}, ∣b∣=9+1=10|\mathbf{b}| = \sqrt{9 + 1} = \sqrt{10}.

cos⁡θ=a⋅b∣a∣∣b∣=1510=150=152\cos \theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}| |\mathbf{b}|} = \frac{1}{\sqrt{5} \sqrt{10}} = \frac{1}{\sqrt{50}} = \frac{1}{5 \sqrt{2}}.

θ=arccos⁡ ⁣(152)≈arccos⁡(0.1414)≈81.87∘\theta = \arccos\!\left( \frac{1}{5 \sqrt{2}} \right) \approx \arccos(0.1414) \approx 81.87^\circ, so about 82∘82^\circ.

Markers reward the formula, the magnitudes, the angle formula, and the rounded numerical answer.

Practise this

Sources & how we know this

ExamExplained