Vectors: Introduction & Geometric Intuition
3089 words
15 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Vectors: Introduction & Geometric Intuition ## ๐ฏ Learning Objectives After this topic you will be able to: - Visualise a vector as a directed arrow in 2D/3D and interpret it as an $n$\-tuple of real numbers - Add vectors geometrically (tip-to-tail) and algebraically component-wise - Multiply a vector by a scalar...

Vectors: Introduction & Geometric Intuition
๐ฏ Learning Objectives
After this topic you will be able to:
- Visualise a vector as a directed arrow in 2D/3D and interpret it as an n-tuple of real numbers
- Add vectors geometrically (tip-to-tail) and algebraically component-wise
- Multiply a vector by a scalar and explain how it stretches or flips the arrow
- Compute the dot product of two vectors in Rn and use it to find the angle between them
- Compute the cross product of two vectors in R3 and interpret it geometrically
- Decompose a vector into components parallel and perpendicular to another vector
๐ Prerequisites
- Basic algebra: arithmetic with real numbers, solving simple equations
- Coordinate geometry (from BSMA1001): plotting points (x,y) in the plane
- This topic builds your geometric intuition for everything that follows in the course
1. What is a Vector?
1.1 Intuition: The Displacement Arrow
Imagine you are standing at a street corner. You walk 3 steps east and then 4 steps north. Where do you end up? The "3 steps east, 4 steps north" is a vector โ it carries magnitude (5 steps, as the crow flies) and direction (north-east).
Every vector has two ingredients:
- Magnitude (length) โ how far
- Direction โ which way In mathematics we represent this idea in two equivalent ways:
- Geometric arrow โ a directed line segment from a starting point A to an ending point B, written AB
- Algebraic n-tuple โ an ordered list of numbers, e.g. (3,4) in the plane or (3,4,โ2) in 3D space The same vector can appear anywhere in space โ translating it does not change it. Only its length and orientation matter.
1.2 Formal Definition
>v=(v1โ,v2โ,โฆ,vnโ)orv=โv1โv2โโฎvnโโโ>Definition (Vector in Rn). A vector is an ordered n-tuple of real numbers
where each viโโR. The set of all such n-tuples is Rn. The first notation (row vector) and second (column vector) are both common. In this course we mostly use column vectors for matrix multiplication compatibility. Key symbols and terminology:
| Symbol | Meaning | Example |
|---|---|---|
| v | a vector (bold lowercase) | v=(1,โ2,5) |
| viโ | the i -th component (coordinate) | v2โ=โ2 |
| Rn | n -dimensional Euclidean space | R2 = the plane |
| 0 | the zero vector (0,0,โฆ,0) | (0,0) in R2 |
1.3 Geometric Representation
(Diagram)
A vector v=(v1โ,v2โ) in R2 is drawn as an arrow from the origin to the point (v1โ,v2โ). Its length (magnitude) is:
For v=(3,4):
In R3, v=(v1โ,v2โ,v3โ) has length v12โ+v22โ+v32โโ.
2. Vector Operations
2.1 Scalar Multiplication
Multiplying a vector v by a scalar (real number) c changes its length but not its direction (unless c is negative, which also flips the direction).
Geometric effect:
- c>1: stretches the arrow
- 0<c<1: shrinks the arrow
- c=0: collapses to the zero vector
- c<0: flips the arrow to point opposite (and stretches/shrinks by โฃcโฃ)
>2v=(4,โ2,6),21โv=(1,โ21โ,23โ),โ3v=(โ6,3,โ9)>Example 1: Scalar multiplicationLet v=(2,โ1,3).
2.2 Vector Addition (and Subtraction)
Add two vectors component-wise:
Geometric intuition: place the tail of w at the head of v; the sum is the arrow from the tail of v to the head of w (the tip-to-tail rule).
(Diagram)
>v+w=(1+3,2+(โ1),โ1+4)=(4,1,3)>Example 2: Vector additionv=(1,2,โ1), w=(3,โ1,4)
Subtraction: vโw=v+(โw)=(1โ3,2โ(โ1),โ1โ4)=(โ2,3,โ5)
2.3 Properties of Vector Operations
These properties hold for all vectors u,v,wโRn and scalars a,bโR:
| Property | Addition | Scalar Multiplication |
|---|---|---|
| Commutativity | u+v=v+u | โ |
| Associativity | (u+v)+w=u+(v+w) | (ab)v=a(bv) |
| Identity | v+0=v | 1v=v |
| Inverse | v+(โv)=0 | โ |
| Distributive | (a+b)v=av+bv | a(u+v)=au+av |
These eight rules form the axioms of a vector space โ we will meet them again in Week 3.
3. Dot Product (Inner Product)
3.1 Intuition: How Much Do Two Vectors Align?
The dot product measures alignment. Two vectors pointing in roughly the same direction have a positive dot product; opposite directions give a negative dot product; perpendicular vectors give zero.
3.2 Definition
>uโ v=u1โv1โ+u2โv2โ+โฏ+unโvnโ=i=1โnโuiโviโ>Definition (Dot Product). For u=(u1โ,โฆ,unโ) and v=(v1โ,โฆ,vnโ) in Rn,
The result is a scalar (a real number), not a vector.
3.3 Relationship to Magnitude
The dot product of a vector with itself gives the squared length:
>uโ vโ=2(1)+(โ1)(4)+3(โ2)=2โ4โ6=โ8โ>Example 3: Dot productu=(2,โ1,3), v=(1,4,โ2)
โฅuโฅ=22+(โ1)2+32โ=4+1+9โ=14โCheck: uโ u=4+1+9=14=(14โ)2 โ
3.4 Geometric Formula and the Angle Between Vectors
The dot product relates to the angle ฮธ between two vectors:
Therefore:
>uโ vโฅuโฅโฅvโฅcosฮธฮธโ=1(0)+0(1)+1(1)=1=1+0+1โ=2โ=0+1+1โ=2โ=2โ2โ1โ=21โ=cosโ1(21โ)=3ฯโ=60โโ>Example 4: Angle between two vectorsFind the angle between u=(1,0,1) and v=(0,1,1).
3.5 Orthogonal (Perpendicular) Vectors
Two vectors are orthogonal (perpendicular) when uโ
v=0.
This is because cos(90โ)=0, so uโ
v=โฅuโฅโฅvโฅโ
0=0.
Example 5: Orthogonal vectorsu=(1,2,โ3), v=(4,1,2)uโ v=1(4)+2(1)+(โ3)(2)=4+2โ6=0 โTherefore uโฅv.
3.6 Properties of the Dot Product
| Property | Formula |
|---|---|
| Commutativity | uโ v=vโ u |
| Linearity | uโ (av+bw)=a(uโ v)+b(uโ w) |
| Positive definiteness | vโ vโฅ0 , and =0 only when v=0 |
| Cauchy-Schwarz | $ |
4. Cross Product (in โยณ)
4.1 Intuition: The Perpendicular Area Vector
While the dot product tells us how much two vectors align, the cross product produces a third vector perpendicular to both. Its magnitude equals the area of the parallelogram spanned by the two input vectors.
4.2 Definition
>uรv=(u2โv3โโu3โv2โ,u3โv1โโu1โv3โ,u1โv2โโu2โv1โ)>Definition (Cross Product). For u=(u1โ,u2โ,u3โ) and v=(v1โ,v2โ,v3โ) in R3,
uรv=โiu1โv1โโju2โv2โโku3โv3โโโThe result is a vector in R3 (unlike the dot product). A handy mnemonic using a determinant:
where i,j,k are the standard basis vectors (1,0,0), (0,1,0), (0,0,1).
4.3 Geometric Interpretation
- Direction: uรv is perpendicular to both u and v (right-hand rule)
- Magnitude: โฅuรvโฅ=โฅuโฅโฅvโฅsinฮธ = area of parallelogram (Diagram)
>uรvโ=(2โ 6โ3โ 5,3โ 4โ1โ 6,1โ 5โ2โ 4)=(12โ15,12โ6,5โ8)=(โ3,6,โ3)โ>Example 6: Cross productu=(1,2,3), v=(4,5,6)
Check orthogonality: uโ (uรv)=1(โ3)+2(6)+3(โ3)=โ3+12โ9=0 โvโ (uรv)=4(โ3)+5(6)+6(โ3)=โ12+30โ18=0 โ
4.4 Properties of Cross Product
| Property | Formula |
|---|---|
| Anti-commutativity | uรv=โ(vรu) |
| Linearity | uร(av+bw)=a(uรv)+b(uรw) |
| Scalar triple product | uโ (vรw)=det[uvw] (volume) |
| Self cross | vรv=0 |
5. Vector Projection
5.1 Intuition: How Much of v Points in the Direction of u?
Projection decomposes a vector v into two parts: one parallel to u and one perpendicular to u.
5.2 Formula
The scalar projection (component) of v onto u is:
The vector projection of v onto u is:
The perpendicular component is:
>vโ uโฅuโฅ2projuโvvโฅโโ=3(1)+1(2)+(โ2)(2)=3+2โ4=1=12+22+22=1+4+4=9=91โ(1,2,2)=(91โ,92โ,92โ)=(3,1,โ2)โ(91โ,92โ,92โ)=(926โ,97โ,โ920โ)โ>Example 7: ProjectionFind the projection of v=(3,1,โ2) onto u=(1,2,2).
6. Edge Cases & Gotchas
| Situation | What Happens | Why It Matters |
|---|---|---|
| **Zero vector 0 ** | Has no direction, length 0 | Dot product with anything is 0; cross product with anything is 0 |
| Division by zero in angle formula | If $\ | \mathbf{u}\ |
| **Cross product only in R3 ** | The 3D cross product does not exist in R2 or Rn for n๎ =3 | In R2 , use the determinant or the "perp dot product" u1โv2โโu2โv1โ |
| Vectors vs. points | A vector is a displacement, not a location | The same vector can be drawn anchored anywhere |
7. Common Pitfalls
โ Pitfall 1: Adding vectors of different dimensions
You cannot add (1,2,3)+(4,5) โ dimensions must match.
โ Pitfall 2: Dot product produces a scalar
uโ
v is a number, not a vector. A common mistake is writing uโ
v=(u1โv1โ,u2โv2โ,โฆ) โ that is the Hadamard (element-wise) product, not the dot product.
โ Pitfall 3: Confusing projection formulas
Scalar projection: โฅuโฅvโ
uโ (a scalar). Vector projection: โฅuโฅ2vโ
uโu (a vector). The difference is dividing by โฅuโฅ vs. โฅuโฅ2.
8. Formula Summary Table
| Concept | Formula | Notes |
|---|---|---|
| Magnitude | $\ | \mathbf{v}\ |
| Dot product | uโ v=โuiโviโ | Result is a scalar |
| Angle | $\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\ | \mathbf{u}\ |
| Orthogonality | uโ v=0 | Perpendicular vectors |
| Cross product (โยณ) | uรv=(u2โv3โโu3โv2โ,โฆ) | Result is a vector |
| Projection | $\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\ | \mathbf{u}\ |
| Cauchy-Schwarz | $ | \mathbf{u} \cdot \mathbf{v} |
9. ๐ Practice Questions
>2u=(4,โ2,6),3v=(0,12,โ6)>Q1: Basic operationsLet u=(2,โ1,3) and v=(0,4,โ2). Compute: (a) 2uโ3v (b) uโ v (c) uรvStrategy: Work component-wise for (a), use sum of products for (b), use determinant formula for (c).Solution (a):
>2uโ3v=(4โ0,โ2โ12,6โ(โ6))=(4,โ14,12)>
>uโ v=2(0)+(โ1)(4)+3(โ2)=0โ4โ6=โ10>Solution (b):
>uรvโ=((โ1)(โ2)โ3(4),3(0)โ2(โ2),2(4)โ(โ1)(0))=(2โ12,0+4,8โ0)=(โ10,4,8)โ>Solution (c):
>uโ v=1(1)+1(0)+1(2)=3>Q2: Angle between vectorsFind the angle between u=(1,1,1) and v=(1,0,2).Strategy: Use cosฮธ=โฅuโฅโฅvโฅuโ vโ.Solution:
>โฅuโฅ=1+1+1โ=3โ,โฅvโฅ=1+0+4โ=5โ>
>cosฮธ=3โ5โ3โ=15โ3โโ0.7746>
>ฮธ=cosโ1(15โ3โ)โ39.2โ>
>uโ v=2(3)+(โ1)(2)+4(โ1)=6โ2โ4=0>Q3: Orthogonality testAre u=(2,โ1,4) and v=(3,2,โ1) orthogonal?Strategy: Compute dot product. If zero, they are orthogonal.Solution:
>vโ u=4(2)+1(โ1)+(โ2)(3)=8โ1โ6=1>Yes, they are orthogonal. Q4: Vector projectionFind the vector projection of v=(4,1,โ2) onto u=(2,โ1,3).Strategy: Use projuโv=โฅuโฅ2vโ uโu.Solution:
>โฅuโฅ2=4+1+9=14>
>projuโv=141โ(2,โ1,3)=(71โ,โ141โ,143โ)>
>uรv=(0(1)โ2(3),2(0)โ1(1),1(3)โ0(0))=(โ6,โ1,3)>Q5: Cross product areaFind the area of the parallelogram spanned by u=(1,0,2) and v=(0,3,1).Strategy: Area = โฅuรvโฅ.Solution:
>Area=(โ6)2+(โ1)2+32โ=36+1+9โ=46โ>
>โฅvโฅ=4+4+1โ=9โ=3>Q6: Unit vectorFind a unit vector in the direction of v=(2,โ2,1).Strategy: Divide the vector by its magnitude.Solution:
>v^=โฅvโฅvโ=(32โ,โ32โ,31โ)>
>โฅuโvโฅ2=1+1โ2(21โ)=2โ1=1>Q7: Dot product propertiesIf u and v are unit vectors and uโ v=21โ, find โฅuโvโฅ.Strategy: Use โฅuโvโฅ2=(uโv)โ (uโv)=โฅuโฅ2+โฅvโฅ2โ2uโ v.Solution:
>โฅuโvโฅ=1>
>wโ=(2(4)โ(โ1)(0),(โ1)(3)โ1(4),1(0)โ2(3))=(8โ0,โ3โ4,0โ6)=(8,โ7,โ6)โ>Q8: Finding a perpendicular vectorFind a vector w in R3 that is perpendicular to both u=(1,2,โ1) and v=(3,0,4).Strategy: Use the cross product w=uรv.Solution:
>bรc=(2(3)โ0(1),0(1)โ0(3),0(1)โ2(1))=(6,0,โ2)>Check: uโ w=1(8)+2(โ7)+(โ1)(โ6)=8โ14+6=0 โ Q9: Scalar triple productFind the volume of the parallelepiped spanned by a=(1,0,0), b=(0,2,0), c=(1,1,3).Strategy: Volume = โฃaโ (bรc)โฃ.Solution:
>aโ (bรc)=1(6)+0(0)+0(โ2)=6>
>Volume=โฃ6โฃ=6>
>vโ u=5+2+1=8,โฅuโฅ2=3>Q10: DecompositionDecompose v=(5,2,1) into components parallel and perpendicular to u=(1,1,1).Strategy: Compute vโฅโ=projuโv, then vโฅโ=vโvโฅโ.Solution:
>vโฅโ=38โ(1,1,1)=(38โ,38โ,38โ)>
>vโฅโ=(5โ38โ,2โ38โ,1โ38โ)=(37โ,โ32โ,โ35โ)>
Check: vโฅโโ vโฅโ=38โโ 37โ+38โโ (โ32โ)+38โโ (โ35โ)=956โ16โ40โ=0 โ
๐ Cross-References
- Next topic: Matrices Introduction โ matrices as arrays of vectors
- BSMA1001 (Maths 1): Review coordinate geometry and basic algebra
- Week 7 (Inner Products): Generalises the dot product to abstract vector spaces
- Week 3 (Vector Spaces): The eight axioms formalise what we've seen here
- BSCS2004 (ML Foundations): Vectors are the data representation in ML Join Discord Next1.2 Matrices Introduction