Vectors in 2D and 3D

Comprehensive guide to vectors for IB Maths AA HL. Covers vector operations, dot product, angle between vectors, vector lines, and applications.

Vectors are a powerful mathematical tool for describing quantities that have both magnitude (size) and direction. They appear throughout IB Mathematics Analysis and Approaches, but are studied in particular depth at HL. Vectors are essential in physics and engineering, and the IB recognises this by testing both computational skills and conceptual understanding.

In this guide, we cover vector operations in 2D and 3D, the scalar (dot) product, finding angles between vectors, and the vector equation of a line. These topics appear frequently in Paper 1 and Paper 2, and vector questions are known for being accessible if you understand the concepts well — but challenging if you rely on rote formulas.

Your IB formula booklet contains the key vector formulas, including the scalar product and the vector equation of a line. As always, understanding when and why to apply each formula is more valuable than memorising them.

Core Concepts

Vector Notation and Representation

A vector can be written as:

  • A bold letter: a (in print) or with an arrow: a\vec{a} (in handwriting, use the arrow notation)
  • A column vector: a=(a1a2)\vec{a} = \begin{pmatrix} a_1 \\ a_2 \end{pmatrix} in 2D or a=(a1a2a3)\vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} in 3D
  • In terms of unit vectors: a=a1i+a2j+a3k\vec{a} = a_1\mathbf{i} + a_2\mathbf{j} + a_3\mathbf{k}

A vector from point AA to point BB is written AB=BA\overrightarrow{AB} = B - A (position vector of BB minus position vector of AA).

Magnitude of a Vector

The magnitude (length) of a=(a1a2a3)\vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} is:

a=a12+a22+a32|\vec{a}| = \sqrt{a_1^2 + a_2^2 + a_3^2}

In 2D, simply omit the a3a_3 term. A unit vector has magnitude 1. The unit vector in the direction of a\vec{a} is a^=aa\hat{a} = \frac{\vec{a}}{|\vec{a}|}.

Vector Operations

Addition and Subtraction

(a1a2a3)+(b1b2b3)=(a1+b1a2+b2a3+b3)\begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} + \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} = \begin{pmatrix} a_1 + b_1 \\ a_2 + b_2 \\ a_3 + b_3 \end{pmatrix}

Geometrically, vector addition follows the triangle rule or parallelogram rule. Subtraction ab\vec{a} - \vec{b} is equivalent to a+(b)\vec{a} + (-\vec{b}).

Scalar Multiplication

ka=k(a1a2a3)=(ka1ka2ka3)k\vec{a} = k\begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} = \begin{pmatrix} ka_1 \\ ka_2 \\ ka_3 \end{pmatrix}

Multiplying by a scalar kk scales the magnitude by k|k| and reverses the direction if k<0k < 0.

Parallel vectors: Two vectors are parallel if one is a scalar multiple of the other: b=ka\vec{b} = k\vec{a} for some scalar kk.

The Scalar (Dot) Product

The scalar product (also called the dot product) of two vectors is defined in two equivalent ways:

Algebraic definition: ab=a1b1+a2b2+a3b3\vec{a} \cdot \vec{b} = a_1b_1 + a_2b_2 + a_3b_3

Geometric definition: ab=abcosθ\vec{a} \cdot \vec{b} = |\vec{a}||\vec{b}|\cos\theta

where θ\theta is the angle between the two vectors.

Both forms are in your IB formula booklet. The key properties:

  • The result is a scalar (a number), not a vector
  • ab=ba\vec{a} \cdot \vec{b} = \vec{b} \cdot \vec{a} (commutative)
  • If ab=0\vec{a} \cdot \vec{b} = 0 and neither vector is the zero vector, then a\vec{a} and b\vec{b} are perpendicular
  • aa=a2\vec{a} \cdot \vec{a} = |\vec{a}|^2

Angle Between Two Vectors

By rearranging the geometric definition:

cosθ=abab\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|}

This is one of the most frequently tested formulas in the IB. The angle θ\theta always satisfies 0°θ180°0° \leq \theta \leq 180°.

Steps to find the angle:

  1. Calculate ab\vec{a} \cdot \vec{b} using the algebraic formula
  2. Calculate a|\vec{a}| and b|\vec{b}|
  3. Substitute into the formula and solve for θ\theta using cos1\cos^{-1}

Perpendicular and Parallel Vectors

  • Perpendicular: ab    ab=0\vec{a} \perp \vec{b} \iff \vec{a} \cdot \vec{b} = 0
  • Parallel: ab    b=ka\vec{a} \parallel \vec{b} \iff \vec{b} = k\vec{a} for some scalar kk

These conditions are used frequently in IB problems.

Vector Equation of a Line

A line in 2D or 3D can be written in vector form:

r=a+td\vec{r} = \vec{a} + t\vec{d}

where:

  • r\vec{r} is the position vector of any point on the line
  • a\vec{a} is the position vector of a known point on the line
  • d\vec{d} is the direction vector of the line
  • tt is a scalar parameter (tRt \in \mathbb{R})

In component form for 3D: (xyz)=(a1a2a3)+t(d1d2d3)\begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} + t\begin{pmatrix} d_1 \\ d_2 \\ d_3 \end{pmatrix}

This gives parametric equations: x=a1+td1x = a_1 + td_1, y=a2+td2y = a_2 + td_2, z=a3+td3z = a_3 + td_3.

Finding the Direction Vector

If you know two points AA and BB on the line, the direction vector is d=AB=BA\vec{d} = \overrightarrow{AB} = B - A. Note that any scalar multiple of d\vec{d} is also a valid direction vector.

Intersection of Lines

To check whether two lines intersect:

  1. Write both lines in parametric form (using different parameters, e.g., tt and ss)
  2. Set the position vectors equal: a1+td1=a2+sd2\vec{a_1} + t\vec{d_1} = \vec{a_2} + s\vec{d_2}
  3. This gives a system of equations — solve for tt and ss
  4. If a consistent solution exists, the lines intersect (substitute to find the point)
  5. If no consistent solution exists, the lines do not intersect (they are skew in 3D, or parallel)

In 3D, two non-parallel lines may be skew — they do not intersect and are not parallel. This cannot happen in 2D.

Distance Concepts

The distance between two points AA and BB is AB|\overrightarrow{AB}|.

At HL, you may also need to find the shortest distance from a point to a line, which involves projection concepts.

Strategy Tips

Tip 1: Draw a Diagram

For vector problems, always sketch the situation — even a rough diagram. Mark known points, vectors, and the unknown you are trying to find. This helps you identify which vectors to add or subtract.

Tip 2: Use Position Vectors Carefully

AB=ba\overrightarrow{AB} = \vec{b} - \vec{a} (end minus start). A common error is computing ab\vec{a} - \vec{b} instead, which gives the vector pointing in the opposite direction.

Tip 3: Check Perpendicularity with the Dot Product

Whenever a question involves right angles or perpendicularity, immediately think "dot product equals zero." This is the standard approach in IB vector problems.

Tip 4: Use Different Parameters for Different Lines

When finding the intersection of two lines, use different letters (e.g., tt and ss) for the parameters. Using the same letter implies the points are reached at the same "time," which may not be the case.

Tip 5: Verify Your Intersection Point

After finding values of tt and ss, substitute into ALL equations (including any third equation in 3D) to verify the solution is consistent. In 3D, if two equations give valid tt and ss but the third does not match, the lines are skew.

Worked Example: Example 1

Problem

Find the angle between a=(121)\vec{a} = \begin{pmatrix} 1 \\ 2 \\ -1 \end{pmatrix} and b=(312)\vec{b} = \begin{pmatrix} 3 \\ -1 \\ 2 \end{pmatrix}.

Solution

ab=(1)(3)+(2)(1)+(1)(2)=322=1\vec{a} \cdot \vec{b} = (1)(3) + (2)(-1) + (-1)(2) = 3 - 2 - 2 = -1

a=1+4+1=6|\vec{a}| = \sqrt{1 + 4 + 1} = \sqrt{6}

b=9+1+4=14|\vec{b}| = \sqrt{9 + 1 + 4} = \sqrt{14}

cosθ=1614=184=1221\cos\theta = \frac{-1}{\sqrt{6} \cdot \sqrt{14}} = \frac{-1}{\sqrt{84}} = \frac{-1}{2\sqrt{21}}

θ=cos1(1221)=96.3°\theta = \cos^{-1}\left(\frac{-1}{2\sqrt{21}}\right) = 96.3° (3 s.f.)

Worked Example: Example 2

Problem

A line passes through A(1,3,2)A(1, 3, -2) and B(4,1,5)B(4, 1, 5). Write the vector equation of the line and determine whether the point C(10,3,19)C(10, -3, 19) lies on it.

Solution

Direction vector: AB=(41135(2))=(327)\overrightarrow{AB} = \begin{pmatrix} 4-1 \\ 1-3 \\ 5-(-2) \end{pmatrix} = \begin{pmatrix} 3 \\ -2 \\ 7 \end{pmatrix}

Vector equation: r=(132)+t(327)\vec{r} = \begin{pmatrix} 1 \\ 3 \\ -2 \end{pmatrix} + t\begin{pmatrix} 3 \\ -2 \\ 7 \end{pmatrix}

To check if C(10,3,19)C(10, -3, 19) lies on the line: 1+3t=10t=31 + 3t = 10 \Rightarrow t = 3 32t=36=33 - 2t = 3 - 6 = -32+7t=2+21=19-2 + 7t = -2 + 21 = 19

All three equations are satisfied with t=3t = 3, so CC lies on the line.

Worked Example: Example 3

Problem

Find the value of kk such that a=(2k3)\vec{a} = \begin{pmatrix} 2 \\ k \\ -3 \end{pmatrix} and b=(46k)\vec{b} = \begin{pmatrix} 4 \\ -6 \\ k \end{pmatrix} are perpendicular.

Solution

For perpendicular vectors: ab=0\vec{a} \cdot \vec{b} = 0

(2)(4)+(k)(6)+(3)(k)=0(2)(4) + (k)(-6) + (-3)(k) = 0

86k3k=08 - 6k - 3k = 0

89k=08 - 9k = 0

k=89k = \frac{8}{9}

Worked Example: Example 4

Problem

Determine whether the following lines intersect, and if so, find the point of intersection.

L1:r=(123)+t(211)L_1: \vec{r} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} + t\begin{pmatrix} 2 \\ -1 \\ 1 \end{pmatrix} and L2:r=(305)+s(111)L_2: \vec{r} = \begin{pmatrix} 3 \\ 0 \\ 5 \end{pmatrix} + s\begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}

Solution

Setting equal: (1+2t2t3+t)=(3+ss5s)\begin{pmatrix} 1+2t \\ 2-t \\ 3+t \end{pmatrix} = \begin{pmatrix} 3+s \\ s \\ 5-s \end{pmatrix}

This gives the system:

  1. 1+2t=3+s1 + 2t = 3 + s
  2. 2t=s2 - t = s
  3. 3+t=5s3 + t = 5 - s

From equation (2): s=2ts = 2 - t.

Substituting into equation (1): 1+2t=3+2t1 + 2t = 3 + 2 - t, so 3t=43t = 4, giving t=43t = \frac{4}{3}.

Then s=243=23s = 2 - \frac{4}{3} = \frac{2}{3}.

Verify with equation (3): 3+43=1333 + \frac{4}{3} = \frac{13}{3} and 523=1335 - \frac{2}{3} = \frac{13}{3}

The lines intersect. Substituting t=43t = \frac{4}{3} into L1L_1:

Point of intersection: (1+83,  243,  3+43)=(113,  23,  133)\left(1 + \frac{8}{3}, \; 2 - \frac{4}{3}, \; 3 + \frac{4}{3}\right) = \left(\frac{11}{3}, \; \frac{2}{3}, \; \frac{13}{3}\right)

Worked Example: Example 5

Problem

The position vectors of points PP, QQ, and RR are p=(210)\vec{p} = \begin{pmatrix} 2 \\ 1 \\ 0 \end{pmatrix}, q=(431)\vec{q} = \begin{pmatrix} 4 \\ 3 \\ -1 \end{pmatrix}, and r=(521)\vec{r} = \begin{pmatrix} 5 \\ 2 \\ 1 \end{pmatrix}. Find the angle QPR\angle QPR.

Solution

The angle at PP is between vectors PQ\overrightarrow{PQ} and PR\overrightarrow{PR}.

PQ=qp=(221)\overrightarrow{PQ} = \vec{q} - \vec{p} = \begin{pmatrix} 2 \\ 2 \\ -1 \end{pmatrix}

PR=rp=(311)\overrightarrow{PR} = \vec{r} - \vec{p} = \begin{pmatrix} 3 \\ 1 \\ 1 \end{pmatrix}

PQPR=6+21=7\overrightarrow{PQ} \cdot \overrightarrow{PR} = 6 + 2 - 1 = 7

PQ=4+4+1=3|\overrightarrow{PQ}| = \sqrt{4 + 4 + 1} = 3

PR=9+1+1=11|\overrightarrow{PR}| = \sqrt{9 + 1 + 1} = \sqrt{11}

cos(QPR)=7311=0.7035\cos(\angle QPR) = \frac{7}{3\sqrt{11}} = 0.7035

QPR=cos1(0.7035)=45.3°\angle QPR = \cos^{-1}(0.7035) = 45.3° (3 s.f.)

Practice Problems

  1. Problem 1

    Given a=(312)\vec{a} = \begin{pmatrix} 3 \\ -1 \\ 2 \end{pmatrix} and b=(142)\vec{b} = \begin{pmatrix} 1 \\ 4 \\ -2 \end{pmatrix}, find ab\vec{a} \cdot \vec{b} and hence determine whether the vectors are perpendicular.

    Problem 2

    Write the vector equation of the line passing through (2,1,3)(2, -1, 3) with direction vector (132)\begin{pmatrix} 1 \\ 3 \\ -2 \end{pmatrix}. Find where the line crosses the xyxy-plane (where z=0z = 0).

    Problem 3

    The vectors u=(12m)\vec{u} = \begin{pmatrix} 1 \\ 2 \\ m \end{pmatrix} and v=(3m4)\vec{v} = \begin{pmatrix} 3 \\ m \\ -4 \end{pmatrix} make an angle of 60°60°. Find the possible values of mm.

    Problem 4

    Two lines are given by L1:r=(012)+t(113)L_1: \vec{r} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + t\begin{pmatrix} 1 \\ -1 \\ 3 \end{pmatrix} and L2:r=(231)+s(211)L_2: \vec{r} = \begin{pmatrix} 2 \\ 3 \\ -1 \end{pmatrix} + s\begin{pmatrix} 2 \\ 1 \\ -1 \end{pmatrix}. Determine whether the lines are parallel, intersecting, or skew.

    Problem 5

    Find a unit vector perpendicular to both a=(102)\vec{a} = \begin{pmatrix} 1 \\ 0 \\ 2 \end{pmatrix} and b=(311)\vec{b} = \begin{pmatrix} 3 \\ 1 \\ -1 \end{pmatrix}. (Hint: use the cross product if you have studied it, or set up a system of equations.)

Want to check your answers and get step-by-step solutions?

Get it on Google PlayDownload on the App Store

Common Mistakes

  • Wrong direction for AB\overrightarrow{AB}. Remember: AB=ba\overrightarrow{AB} = \vec{b} - \vec{a} (destination minus origin). Getting this backwards gives the opposite direction and leads to sign errors.

  • Forgetting the denominator in the angle formula. The formula is cosθ=abab\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|}. Students sometimes forget the magnitudes in the denominator.

  • Using the same parameter for two different lines. When finding intersections, always use different parameters (tt and ss). Using the same parameter implies the points correspond at the same parameter value, which is an unjustified assumption.

  • Concluding lines are parallel when they are skew. In 3D, non-intersecting lines can be either parallel or skew. Check direction vectors: if one is a scalar multiple of the other, the lines are parallel; otherwise, they are skew.

  • Arithmetic errors in 3D. With three components, there are more places for arithmetic errors. Double-check each component carefully, especially in dot product calculations.

  • Confusing position vectors and direction vectors. The position vector a\vec{a} in the line equation r=a+td\vec{r} = \vec{a} + t\vec{d} is a fixed point; d\vec{d} is the direction. Do not mix them up when reading or writing line equations.

Frequently Asked Questions

What is the difference between a position vector and a direction vector?

A position vector points from the origin to a specific point and represents a location. A direction vector represents a direction and magnitude but has no fixed starting point — it can be "placed" anywhere. In the line equation r=a+td\vec{r} = \vec{a} + t\vec{d}, a\vec{a} is a position vector (a specific point on the line) and d\vec{d} is a direction vector.

Is the scalar product the same as the cross product?

No! The scalar (dot) product ab\vec{a} \cdot \vec{b} gives a scalar (number). The vector (cross) product a×b\vec{a} \times \vec{b} gives a vector perpendicular to both. The cross product is part of the HL curriculum. At SL, you only need the dot product.

Can two lines in 3D fail to intersect and not be parallel?

Yes — such lines are called skew lines. They exist in different "layers" of 3D space and never meet. This is one of the key differences between 2D and 3D geometry.

How do I know if a point lies on a line?

Substitute the point's coordinates into the parametric equations and check if there is a single consistent value of tt that satisfies all equations simultaneously.

Do I need to simplify direction vectors?

It is not required but can be helpful. Any scalar multiple of a direction vector gives the same line. For example, (6410)\begin{pmatrix} 6 \\ -4 \\ 10 \end{pmatrix} can be simplified to (325)\begin{pmatrix} 3 \\ -2 \\ 5 \end{pmatrix}. Simpler numbers reduce the chance of arithmetic errors.

Key Takeaways

  • Vectors have magnitude and direction. Master the basic operations (addition, subtraction, scalar multiplication) and always work component-by-component.

  • The dot product is the key to angles and perpendicularity. Use ab=a1b1+a2b2+a3b3\vec{a} \cdot \vec{b} = a_1b_1 + a_2b_2 + a_3b_3 for calculations and cosθ=abab\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|} for angles. If the dot product is zero, the vectors are perpendicular.

  • Vector line equations use a point and a direction. r=a+td\vec{r} = \vec{a} + t\vec{d} describes every point on a line. Find d\vec{d} from two known points if needed.

  • Intersection problems require different parameters. Set the line equations equal using different parameter names, solve the system, and verify all components.

  • 3D introduces skew lines. Unlike 2D, non-parallel lines in 3D may never meet. Always verify your intersection solution with all three component equations.

  • Draw diagrams and check your work. Vector problems reward careful, systematic working. Label vectors clearly and verify answers by substitution.

Ready to Ace Your IB mathematics?

Get instant step-by-step solutions to any problem. Snap a photo and learn with Tutor AI — your personal exam prep companion.

Get it on Google PlayDownload on the App Store