← Back to High School Math

Matrices and Vectors

High School Math · Pre-CalculusPreview

1. Introduction

Vectors and matrices are the language of everything that has direction or structure: forces in physics, velocities in navigation, pixels and rotations in computer graphics, and the systems of equations at the heart of economics and engineering. A vector packages several numbers into a single object that carries both magnitude (size) and direction. A matrix packages numbers into a rectangular grid that can represent a system of equations, a data table, or — most powerfully — a transformation that moves vectors around the plane.

Why bundle numbers this way? Because it lets us compute with whole collections at once. Adding two displacements, scaling a velocity, projecting one direction onto another, rotating a shape, or solving two equations in two unknowns all become single, clean operations. Matrices and vectors are also your bridge into linear algebra, the most widely applied branch of modern mathematics and the foundation of machine learning and 3D graphics.

This article builds both ideas from scratch: vector components, addition, scaling, magnitude, and the all-important dot product (with the angle-between-vectors interpretation), then matrices — addition, scalar and matrix multiplication, the identity, the determinant, and the inverse — finishing with how a 2×22\times 2 system is solved with matrices and how matrices encode geometric transformations.

Vectors answer "which way and how far?"; matrices answer "what happens when we transform every direction at once?" In two dimensions, a single 2×22\times 2 matrix can rotate, reflect, stretch, or shear the entire plane. Multiplying that matrix by a column vector applies the transformation to one point. This is the same mathematics that drives video-game graphics, GPS navigation, and robotics — but at the precalculus level, mastering component arithmetic and 2×22\times 2 algebra is the essential foundation.

2. Core Concepts

2.1 Vectors and Component Form

A vector in the plane is written in component form as v=a,b\vec v = \langle a, b\rangle, meaning "move aa in the xx-direction and bb in the yy-direction." Geometrically it's an arrow; its tail can sit anywhere, but its components (the change in xx and yy from tail to head) are what define it. A vector from point P(x1,y1)P(x_1, y_1) to Q(x2,y2)Q(x_2, y_2) has components x2x1,  y2y1\langle x_2 - x_1,\; y_2 - y_1\rangle.

Equivalently, vectors appear as column vectors [ab]\begin{bmatrix} a \\ b \end{bmatrix}. The two notations carry the same information; column form pairs naturally with matrix multiplication.

2.2 Vector Addition and Scalar Multiplication

To add vectors, add corresponding components: a,b+c,d=a+c,  b+d.\langle a, b\rangle + \langle c, d\rangle = \langle a + c,\; b + d\rangle. Geometrically this is the tip-to-tail rule: place the tail of the second arrow at the head of the first; the sum runs from the first tail to the last head. To scale a vector by a number (a scalar) kk, multiply each component: ka,b=ka,  kb.k\langle a, b\rangle = \langle ka,\; kb\rangle. A positive kk stretches or shrinks the arrow; a negative kk also reverses its direction. Subtraction is addition of a negative: uv=u+(1)v\vec u - \vec v = \vec u + (-1)\vec v.

2.3 Magnitude and Unit Vectors

The magnitude (length) of v=a,b\vec v = \langle a, b\rangle comes straight from the Pythagorean theorem, since the components are perpendicular legs: v=a2+b2.\|\vec v\| = \sqrt{a^2 + b^2}. A unit vector has magnitude 11; to make one in the direction of v\vec v, divide by the magnitude: v^=1vv\hat v = \dfrac{1}{\|\vec v\|}\vec v. This separates a vector's direction (the unit vector) from its size (the magnitude).

2.4 The Dot Product

The dot product of two vectors multiplies corresponding components and adds: a,bc,d=ac+bd.\langle a, b\rangle \cdot \langle c, d\rangle = ac + bd. The result is a single number (a scalar), not a vector. It measures how much two vectors point the same way, via the geometric formula uv=uvcosθ,\vec u \cdot \vec v = \|\vec u\|\,\|\vec v\|\cos\theta, where θ\theta is the angle between them. Two consequences are vital: the vectors are perpendicular exactly when their dot product is 00 (because cos90=0\cos 90^\circ = 0), and you can find the angle between vectors by solving cosθ=uvuv\cos\theta = \dfrac{\vec u\cdot \vec v}{\|\vec u\|\,\|\vec v\|}.

2.5 Projection onto a Vector

The scalar projection of u\vec u onto v\vec v is compvu=uvv\text{comp}_{\vec v}\,\vec u = \dfrac{\vec u \cdot \vec v}{\|\vec v\|}. The vector projection is this scalar times the unit vector in the direction of v\vec v: projvu=uvv2v.\text{proj}_{\vec v}\,\vec u = \frac{\vec u \cdot \vec v}{\|\vec v\|^2}\,\vec v. Projection answers "how much of u\vec u lies along v\vec v?" — essential in physics (work =Fd= \vec F \cdot \vec d) and graphics.

2.6 Linear Combinations

A linear combination of vectors v1,v2,\vec v_1, \vec v_2, \ldots with scalars c1,c2,c_1, c_2, \ldots is c1v1+c2v2+c_1\vec v_1 + c_2\vec v_2 + \cdots. Every vector in the plane can be written as a combination of the standard basis vectors i=1,0\vec i = \langle 1, 0\rangle and j=0,1\vec j = \langle 0, 1\rangle: a,b=ai+bj\langle a, b\rangle = a\vec i + b\vec j.

2.7 Matrices and Basic Operations

A matrix is a rectangular array of numbers with rows and columns; an m×nm\times n matrix has mm rows and nn columns. An entry is named by its position, e.g. aija_{ij} is row ii, column jj. You add (or subtract) matrices of the same size entry-by-entry, and multiply a matrix by a scalar by multiplying every entry. For example, [1234]+[5678]=[681012].\begin{bmatrix} 1 & 2 \\ 3 & 4\end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8\end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12\end{bmatrix}.

2.8 Matrix Multiplication

Matrix multiplication is not entry-by-entry. To multiply ABAB, you dot each row of AA with each column of BB. The entry in row ii, column jj of the product is the dot product of row ii of AA with column jj of BB. This requires the number of columns of AA to equal the number of rows of BB; an (m×n)(m\times n) times (n×p)(n\times p) product is (m×p)(m\times p).

Crucially, matrix multiplication is not commutative: in general ABBAAB \neq BA, and sometimes only one order is even defined. The reason is that a matrix represents a transformation, and "rotate then stretch" generally differs from "stretch then rotate."

2.9 Identity, Determinant, and Inverse

The identity matrix II has 11s on the main diagonal and 00s elsewhere; it acts like the number 11: AI=IA=AAI = IA = A. For a 2×22\times 2 matrix the determinant is det[abcd]=adbc.\det\begin{bmatrix} a & b \\ c & d\end{bmatrix} = ad - bc. The determinant tells you whether the matrix has an inverse: an inverse exists exactly when det0\det \neq 0. Geometrically, det|\det| is the factor by which the matrix scales area, and a determinant of 00 means the transformation collapses the plane (no inverse). The inverse of a 2×22\times 2 matrix is [abcd]1=1adbc[dbca],\begin{bmatrix} a & b \\ c & d\end{bmatrix}^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a\end{bmatrix}, obtained by swapping aa and dd, negating bb and cc, and dividing by the determinant. The inverse undoes the matrix: AA1=IAA^{-1} = I.

2.10 Solving Linear Systems with Matrices

A system like {ax+by=ecx+dy=f\begin{cases} ax + by = e \\ cx + dy = f\end{cases} is the matrix equation Ax=bA\vec x = \vec b with A=[abcd]A = \begin{bmatrix} a & b \\ c & d\end{bmatrix}, x=[xy]\vec x = \begin{bmatrix} x \\ y\end{bmatrix}, b=[ef]\vec b = \begin{bmatrix} e \\ f\end{bmatrix}. If detA0\det A \neq 0, multiply both sides by A1A^{-1} to get x=A1b\vec x = A^{-1}\vec b — a single formula for the solution.

2.11 Matrices as Transformations

Multiplying a column vector by a matrix transforms it. The matrix [abcd]\begin{bmatrix} a & b \\ c & d\end{bmatrix} sends [xy]\begin{bmatrix} x \\ y\end{bmatrix} to [ax+bycx+dy]\begin{bmatrix} ax + by \\ cx + dy\end{bmatrix}. The rotation matrix for angle θ\theta is [cosθsinθsinθcosθ].\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{bmatrix}. A dilation by kk is [k00k]\begin{bmatrix} k & 0 \\ 0 & k\end{bmatrix}. Matrix multiplication composes transformations: applying BB then AA is the matrix product ABAB.

2.12 Augmented Matrices and Row Operations (Preview)

An augmented matrix [abecdf]\left[\begin{array}{cc|c} a & b & e \\ c & d & f \end{array}\right] encodes the same system.

2.13 Magnitude Properties and the Triangle Inequality

For vectors, u+vu+v\|\vec u + \vec v\| \le \|\vec u\| + \|\vec v\| (triangle inequality) — the direct path is never longer than the detour. Equality holds when u\vec u and v\vec v point the same direction. Also kv=kv\|k\vec v\| = |k|\,\|\vec v\|: scaling changes length by the absolute value of the scalar. These properties mirror ordinary distance on the number line and justify why unit vectors normalize by dividing by magnitude. Row operations (swap rows, multiply a row by a nonzero constant, add a multiple of one row to another) preserve the solution set and lead to Gaussian elimination — an alternative to the inverse method for larger systems.

Continue reading with Premium

Upgrade to read the full article and unlock all Premium features.

Free

  • Unlimited practice — all difficulties
  • 3 hints / day
  • Community solutions
  • 2 timed mocks / month

Premium

  • Full article + all 57+ theory guides
  • Unlimited hints on practice problems
  • Unlimited timed mock exams & PDF worksheets
Log in