In OCR H446, a vector is a mathematical object representing a quantity with both magnitude and direction, represented as an ordered list of numbers (components). Vectors are used extensively in computer graphics, physics simulations, machine learning, and data science.
A vector can also refer to a 1D array of numbers in computing. Both definitions are relevant — the mathematical properties directly inform how they are implemented and used.
An n-dimensional vector is written as an ordered tuple of n real numbers:
Vectors can also be written as column vectors (matrices with one column) or as lists/arrays in code.
Add corresponding components: (a₁, a₂) + (b₁, b₂) = (a₁+b₁, a₂+b₂)
Multiply each component by a scalar k: k × (a₁, a₂) = (k×a₁, k×a₂)
Produces a scalar: a · b = a₁×b₁ + a₂×b₂ + ... + aₙ×bₙ
The magnitude (or length/norm) of vector v = (a, b) is:
A unit vector has magnitude 1. To normalise vector v: divide each component by |v|.
A convex combination of two vectors u and v is: w = (1−t)u + tv, where 0 ≤ t ≤ 1. As t goes from 0 to 1, w moves linearly from u to v — this is used for interpolation in graphics (e.g. blending colours, smooth animation transitions).
| Application | How Vectors are Used |
|---|---|
| Computer graphics (2D/3D) | Position vectors, velocity, direction of light, surface normals |
| Physics engines | Force vectors, acceleration, velocity; vector addition for resultant force |
| Machine learning | Feature vectors (each dimension = one feature); word embeddings |
| Computer vision | Image as vector of pixel values; distance between image vectors for similarity |
| GPS/Navigation | Position and displacement vectors; finding shortest path direction |
| Cryptography | Lattice-based cryptography uses high-dimensional vectors |
Vectors are typically implemented as one-dimensional arrays or lists:
| Operation | Formula | Result type |
|---|---|---|
| Addition | (a₁+b₁, a₂+b₂, ...) | Vector |
| Scalar multiplication | (k×a₁, k×a₂, ...) | Vector |
| Dot product | a₁b₁ + a₂b₂ + ... + aₙbₙ | Scalar |
| Magnitude | √(a₁² + a₂² + ... + aₙ²) | Scalar |
| Normalisation | v / |v| | Vector (unit vector) |
| Convex combination | (1-t)u + tv, 0 ≤ t ≤ 1 | Vector (on line between u,v) |
8 questions · 20 marks · instantly marked
| Term | Definition |
|---|