---
title: Affine Combinations
module: Geometry of Vector Spaces
moduleNumber: 9
lessonNumber: 1
order: 901
summary: >
  An affine combination is a linear combination whose weights sum to one. The
  affine hull of a set is the smallest flat containing it: a point, a line, a
  plane, or a translated subspace. Homogeneous coordinates turn every affine
  combination into an ordinary linear combination one dimension up.
topics: [Geometry of Vector Spaces]
sources:
  - book: Lay
    ref: "Ch. 8 — The Geometry of Vector Spaces; §8.1 Affine Combinations"
draft: false
---

Most of linear algebra treats a subspace as the primary object: a set closed
under all linear combinations, always containing the origin. Geometry needs
lines and planes that miss the origin, triangles, and solid bodies. The device
that produces them is a single restriction on the weights of a linear
combination.[^lay-affine]

Given points $\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_p$ in $\mathbb{R}^n$
and scalars $c_1, \dots, c_p$, an **affine combination** is a linear combination

$$
c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_p\mathbf{v}_p
\qquad\text{with}\qquad
c_1 + c_2 + \cdots + c_p = 1.
$$

The set of all affine combinations of points in a set $S$ is the **affine hull**
(or affine span) of $S$, written $\operatorname{aff} S$. The affine hull of a
single point $\mathbf{v}_1$ is $\{\mathbf{v}_1\}$, since the only admissible
weight is $c_1 = 1$.

## The line through two points

For two distinct points $\mathbf{v}_1, \mathbf{v}_2$, an affine combination has
weights $c_1 + c_2 = 1$. Write $t = c_2$, so $c_1 = 1 - t$, and

$$
\mathbf{y} = (1-t)\mathbf{v}_1 + t\mathbf{v}_2, \qquad t \in \mathbb{R}.
$$

This passes through $\mathbf{v}_1$ at $t=0$ and $\mathbf{v}_2$ at $t=1$.
Regrouping exposes its structure as a translate:

$$
\mathbf{y} = \mathbf{v}_1 + t(\mathbf{v}_2 - \mathbf{v}_1) = \mathbf{p} + t\mathbf{u},
$$

where $\mathbf{p} = \mathbf{v}_1$ and $\mathbf{u} = \mathbf{v}_2 - \mathbf{v}_1$.
The multiples $t\mathbf{u}$ trace $\operatorname{Span}\{\mathbf{u}\}$, the line
through the origin in the direction $\mathbf{u}$. Adding $\mathbf{p}$ shifts that
line to pass through $\mathbf{v}_1$. So $\operatorname{aff}\{\mathbf{v}_1,
\mathbf{v}_2\}$ is the line through $\mathbf{v}_1$ and $\mathbf{v}_2$.

$$
% caption: The affine hull of two points is the line through them, equal to the
% span of $\mathbf{u}=\mathbf{v}_2-\mathbf{v}_1$ translated by $\mathbf{p}=\mathbf{v}_1$.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.1]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
\coordinate (O) at (0,0);
\coordinate (V1) at (1.4,0.7);
\coordinate (V2) at (3.6,1.8);
% span line through origin
\draw[red!70, thick] (-1.0,-0.5) -- (2.4,1.2);
\draw[->, red, very thick] (O) -- (2.2,1.1);
\node[red, anchor=north west] at (2.2,1.05) {$\mathbf{u}$};
\node[red!80, anchor=north] at (-0.7,-0.35) {span $\mathbf{u}$};
% affine line through v1, v2
\draw[acc, thick] (0.3,0.15) -- (4.6,2.3);
\draw[->, acc, very thick] (O) -- (V1);
\node[acc, anchor=south east] at (1.35,0.72) {$\mathbf{p}$};
\fill[acc] (V1) circle (1.6pt) node[anchor=north west] {$\mathbf{v}_1$};
\fill[acc] (V2) circle (1.6pt) node[anchor=north west] {$\mathbf{v}_2$};
\node[acc, anchor=south, font=\scriptsize] at (4.0,2.05) {the line};
\fill[black] (O) circle (1.4pt) node[anchor=north east] {$O$};
% translation arrow
\draw[->, black, dashed] (2.2,1.1) -- ($(V1)+(2.2-1.4,1.1-0.7)$);
\end{tikzpicture}
$$

The relation between $\mathbf{y}$ and the shifted point $\mathbf{y} -
\mathbf{v}_1$ holds for any number of points.

> **Theorem (Affine combinations via translated points).** A point $\mathbf{y}$ in $\mathbb{R}^n$ is an affine combination
> of $\mathbf{v}_1, \dots, \mathbf{v}_p$ if and only if $\mathbf{y} -
> \mathbf{v}_1$ is a linear combination of the translated points $\mathbf{v}_2 -
> \mathbf{v}_1, \dots, \mathbf{v}_p - \mathbf{v}_1$.

If $\mathbf{y} - \mathbf{v}_1 = c_2(\mathbf{v}_2 - \mathbf{v}_1) + \cdots +
c_p(\mathbf{v}_p - \mathbf{v}_1)$, then collecting the $\mathbf{v}_1$ terms gives

$$
\mathbf{y} = \big(1 - c_2 - \cdots - c_p\big)\mathbf{v}_1 + c_2\mathbf{v}_2 +
\cdots + c_p\mathbf{v}_p,
$$

whose weights sum to $1$. The converse reverses the algebra: $c_1 = 1 - c_2 -
\cdots - c_p$ turns any affine combination back into a linear combination of the
translated points. The point $\mathbf{v}_1$ carries no special role; any point
in the list can play the base.

The translated-points criterion turns the membership question into a row reduction. Subtract
$\mathbf{v}_1$ from every point and test whether $\mathbf{y} - \mathbf{v}_1$
lies in the span of the translated set.

> **Worked example.** Let $\mathbf{v}_1 = (1,2)$, $\mathbf{v}_2 = (2,5)$,
> $\mathbf{v}_3 = (1,3)$, $\mathbf{v}_4 = (-2,2)$, and $\mathbf{y} = (4,1)$.
> Write $\mathbf{y}$ as an affine combination of the four points if possible.
>
> Translate by $\mathbf{v}_1$:
> $$
> \mathbf{v}_2 - \mathbf{v}_1 = \begin{bmatrix} 1 \\ 3 \end{bmatrix}, \quad
> \mathbf{v}_3 - \mathbf{v}_1 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad
> \mathbf{v}_4 - \mathbf{v}_1 = \begin{bmatrix} -3 \\ 0 \end{bmatrix}, \quad
> \mathbf{y} - \mathbf{v}_1 = \begin{bmatrix} 3 \\ -1 \end{bmatrix}.
> $$
> Row reduce the augmented matrix with these as columns:
> $$
> \left[\begin{array}{ccc|c} 1 & 0 & -3 & 3 \\ 3 & 1 & 0 & -1 \end{array}\right]
> \sim
> \left[\begin{array}{ccc|c} 1 & 0 & -3 & 3 \\ 0 & 1 & 9 & -10 \end{array}\right].
> $$
> The system is consistent, with general solution $c_2 = 3 + 3c_4$, $c_3 = -10 -
> 9c_4$, and $c_4$ free. Taking $c_4 = 0$ gives $c_2 = 3$, $c_3 = -10$, and
> $c_1 = 1 - 3 + 10 = 8$:
> $$
> \mathbf{y} = 8\mathbf{v}_1 + 3\mathbf{v}_2 - 10\mathbf{v}_3.
> $$
> A different choice $c_4 = 1$ produces $\mathbf{y} = 13\mathbf{v}_1 +
> 6\mathbf{v}_2 - 19\mathbf{v}_3 + \mathbf{v}_4$. The representation is not
> unique because the five points are more than a plane can independently support.

When the points $\mathbf{v}_i$ are a basis $\mathcal{B} = \{\mathbf{b}_1, \dots,
\mathbf{b}_n\}$ for $\mathbb{R}^n$, the test is immediate: every $\mathbf{y}$ has
unique $\mathcal{B}$-coordinates, and $\mathbf{y}$ is an affine combination of the
basis exactly when those coordinates sum to $1$.

> **Worked example.** Let $\mathbf{b}_1 = (4,0,3)$, $\mathbf{b}_2 = (0,4,2)$,
> $\mathbf{b}_3 = (5,2,4)$, a basis for $\mathbb{R}^3$. For $\mathbf{p}_1 =
> (9,6,9)$ and $\mathbf{p}_2 = (1,2,2)$, decide which is an affine combination of
> the basis.
>
> The $\mathcal{B}$-coordinates come from row reducing $[\,\mathbf{b}_1\;
> \mathbf{b}_2\; \mathbf{b}_3\mid \mathbf{p}_1\; \mathbf{p}_2\,]$, giving
> $$
> \mathbf{p}_1 = \mathbf{b}_1 + \mathbf{b}_2 + \mathbf{b}_3,
> \qquad
> \mathbf{p}_2 = \tfrac{2}{3}\mathbf{b}_1 + \tfrac{2}{3}\mathbf{b}_2 -
> \tfrac{1}{3}\mathbf{b}_3.
> $$
> The weights for $\mathbf{p}_1$ sum to $3$, so $\mathbf{p}_1$ is not an affine
> combination. The weights for $\mathbf{p}_2$ sum to $1$, so $\mathbf{p}_2$ is.

## The affine hull as a flat

Although every linear combination of $\mathbf{b}_1, \mathbf{b}_2, \mathbf{b}_3$
fills all of $\mathbb{R}^3$, the affine combinations fill only the plane through
the three points. That plane contains $\mathbf{p}_2$ and misses $\mathbf{p}_1$.

$$
% caption: The span of three independent points is all of $\mathbb{R}^3$; their
% affine hull is only the plane through them. Here $\mathbf{p}_2$ lies on that
% plane and $\mathbf{p}_1$ does not.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
% the affine plane, drawn as a parallelogram
\fill[acc!10] (0,0) -- (4.2,0.6) -- (5.4,2.6) -- (1.2,2.0) -- cycle;
\draw[acc, thick] (0,0) -- (4.2,0.6) -- (5.4,2.6) -- (1.2,2.0) -- cycle;
\fill[acc] (1.3,0.9) circle (1.6pt) node[anchor=north east] {$\mathbf{b}_1$};
\fill[acc] (3.5,1.2) circle (1.6pt) node[anchor=north] {$\mathbf{b}_2$};
\fill[acc] (2.8,2.1) circle (1.6pt) node[anchor=south] {$\mathbf{b}_3$};
\fill[black] (2.6,1.4) circle (1.6pt) node[anchor=north west] {$\mathbf{p}_2$};
\node[acc, anchor=north west, font=\scriptsize] at (4.4,1.0) {plane of the three};
% point off the plane
\fill[red] (3.0,3.4) circle (1.8pt) node[anchor=south] {$\mathbf{p}_1$};
\draw[red, dashed] (3.0,3.4) -- (2.9,1.7);
\node[red!80, anchor=west, font=\scriptsize] at (3.1,3.0) {outside the plane};
\end{tikzpicture}
$$

A set whose affine hull equals itself deserves a name. A set $S$ is **affine** if
for every $\mathbf{p}, \mathbf{q} \in S$ and every real $t$, the point $(1-t)
\mathbf{p} + t\mathbf{q}$ is in $S$. Geometrically, whenever $S$ contains two
points it contains the entire line through them.

> **Theorem (Affine sets contain their affine combinations).** A set $S$ is affine if and only if every affine combination of
> points of $S$ lies in $S$; equivalently, $S = \operatorname{aff} S$.

The line condition covers combinations of two points by definition. An induction
extends it to any number: for a combination $c_1\mathbf{v}_1 + \cdots +
c_{k+1}\mathbf{v}_{k+1}$ of points in $S$, at least one weight differs from $1$,
say $c_{k+1}$. Set $t = c_1 + \cdots + c_k = 1 - c_{k+1} \neq 0$. Then

$$
\mathbf{y} = (1 - c_{k+1})\Big(\tfrac{c_1}{t}\mathbf{v}_1 + \cdots +
\tfrac{c_k}{t}\mathbf{v}_k\Big) + c_{k+1}\mathbf{v}_{k+1}
$$

expresses $\mathbf{y}$ as an affine combination of two points of $S$: the
inner combination has weights summing to $1$ and lies in $S$ by the induction
hypothesis.

$$
% caption: The set on the left is affine because every chord extends to a full
% line inside it; the set on the right is not, since the line through two of its
% points leaves it.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
% left: an affine set (a full line)
\draw[acc, thick] (-0.3,0.0) -- (3.3,1.6);
\fill[acc] (0.6,0.4) circle (1.6pt) node[anchor=south east] {$\mathbf{p}$};
\fill[acc] (2.4,1.2) circle (1.6pt) node[anchor=north west] {$\mathbf{q}$};
\node[acc, anchor=north] at (1.5,0.35) {$S$};
% right: a bounded blob, not affine
\begin{scope}[shift={(5.4,0.0)}]
\fill[red!10] (0,0.8) .. controls (0.2,2.1) and (2.0,2.1) .. (2.2,0.9)
  .. controls (2.3,-0.2) and (0.1,-0.3) .. (0,0.8) -- cycle;
\draw[red, thick] (0,0.8) .. controls (0.2,2.1) and (2.0,2.1) .. (2.2,0.9)
  .. controls (2.3,-0.2) and (0.1,-0.3) .. (0,0.8);
\fill[red] (0.5,0.6) circle (1.6pt) node[anchor=north] {$\mathbf{p}$};
\fill[red] (1.7,1.3) circle (1.6pt) node[anchor=south] {$\mathbf{q}$};
\draw[red!70, dashed] (-0.4,0.35) -- (2.7,1.75);
\node[red, anchor=west] at (2.4,0.3) {$T$};
\end{scope}
\end{tikzpicture}
$$

### Flats and their dimension

The definition ties affine sets to subspaces. A **translate** of a set $S$ by a
vector $\mathbf{p}$ is $S + \mathbf{p} = \{\mathbf{s} + \mathbf{p} : \mathbf{s}
\in S\}$. A **flat** in $\mathbb{R}^n$ is a translate of a subspace. Two flats are
**parallel** if one is a translate of the other, and the **dimension** of a flat
is the dimension of that parallel subspace.

- **Line**: a flat of dimension $1$.
- **Hyperplane**: a flat of dimension $n-1$.
- **Point**: a flat of dimension $0$.

In $\mathbb{R}^3$ the proper flats are points, lines, and planes, each of which
may or may not pass through the origin. The dimension of an arbitrary set $S$,
written $\dim S$, is the dimension of the smallest flat that contains it.

> **Theorem (Affine sets are flats).** A nonempty set $S$ is affine if and only if it is a flat.

Fix $\mathbf{p} \in S$ and let $W = S - \mathbf{p}$. Since $\mathbf{p} \in S$,
the zero vector lies in $W$. For $\mathbf{u}_1 = \mathbf{s}_1 - \mathbf{p}$ and
$\mathbf{u}_2 = \mathbf{s}_2 - \mathbf{p}$ in $W$, a direct computation gives

$$
\mathbf{u}_1 + t\mathbf{u}_2 = (1-t)\mathbf{s}_1 + t(\mathbf{s}_1 + \mathbf{s}_2
- \mathbf{p}) - \mathbf{p}.
$$

The point $\mathbf{s}_1 + \mathbf{s}_2 - \mathbf{p}$ is an affine combination of
points of $S$, hence in $S$, and one more affine combination keeps the result in
$S$, so $\mathbf{u}_1 + t\mathbf{u}_2 \in W$. Thus $W$ is a subspace and $S = W +
\mathbf{p}$ is a flat. The converse runs the same identity backward. The affine-sets-are-flats
theorem gives the affine hull its geometric reading: $\operatorname{aff} S$ is the
smallest flat containing $S$.

A familiar object is now recognizable as a flat.

> **Worked example.** Suppose the solutions of $A\mathbf{x} = \mathbf{b}$ all
> have the form $\mathbf{x} = x_3\mathbf{u} + \mathbf{p}$, with $\mathbf{u} =
> (2,3,-1)$ and $\mathbf{p} = (4,0,3)$. Write this solution set as
> $\operatorname{aff}\{\mathbf{v}_1, \mathbf{v}_2\}$.
>
> The solution set is the line through $\mathbf{p}$ in the direction
> $\mathbf{u}$, parallel to the solution set of $A\mathbf{x} = \mathbf{0}$. Pick
> two points on it: $x_3 = 0$ gives $\mathbf{v}_1 = \mathbf{p} = (4,0,3)$, and
> $x_3 = 1$ gives
> $$
> \mathbf{v}_2 = \mathbf{u} + \mathbf{p} = (6,3,2).
> $$
> Then the solution set is $\operatorname{aff}\{\mathbf{v}_1, \mathbf{v}_2\} =
> \{(1-x_3)\mathbf{v}_1 + x_3\mathbf{v}_2 : x_3 \in \mathbb{R}\}$.

$$
% caption: The solution set of $A\mathbf{x}=\mathbf{b}$ is the null-space line
% $A\mathbf{x}=\mathbf{0}$ translated by any particular solution $\mathbf{p}$; two
% of its points serve as $\mathbf{v}_1$ and $\mathbf{v}_2$.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
\coordinate (O) at (0,0);
% null-space line through origin
\draw[red!70, thick] (-1.2,-1.0) -- (2.6,2.2);
\node[red, anchor=south east] at (2.4,2.05) {$A\mathbf{x}=\mathbf{0}$};
\draw[->, red, very thick] (O) -- (1.3,1.1);
\node[red, anchor=north west] at (1.25,1.05) {$\mathbf{u}$};
% solution line translated
\draw[acc, thick] (1.3,-0.9) -- (5.1,2.3);
\node[acc, anchor=south east] at (5.0,2.15) {$A\mathbf{x}=\mathbf{b}$};
\fill[acc] (2.6,0.2) circle (1.6pt) node[anchor=north west] {$\mathbf{v}_1=\mathbf{p}$};
\fill[acc] (3.9,1.3) circle (1.6pt) node[anchor=north west] {$\mathbf{v}_2$};
\draw[->, black, dashed] (O) -- (2.6,0.2);
\fill[black] (O) circle (1.4pt) node[anchor=north east] {$O$};
\end{tikzpicture}
$$

## Homogeneous coordinates

Affine combinations become ordinary linear combinations after one lift. For
$\mathbf{v}$ in $\mathbb{R}^n$, the **standard homogeneous form** is

$$
\tilde{\mathbf{v}} = \begin{bmatrix} \mathbf{v} \\ 1 \end{bmatrix} \in
\mathbb{R}^{n+1},
$$

the point $\mathbf{v}$ lifted to the plane where the last coordinate equals $1$.

> **Theorem (Affine combinations via homogeneous forms).** A point $\mathbf{y}$ is an affine combination of $\mathbf{v}_1,
> \dots, \mathbf{v}_p$ if and only if $\tilde{\mathbf{y}}$ lies in
> $\operatorname{Span}\{\tilde{\mathbf{v}}_1, \dots, \tilde{\mathbf{v}}_p\}$. In
> fact $\mathbf{y} = c_1\mathbf{v}_1 + \cdots + c_p\mathbf{v}_p$ with $\sum c_i =
> 1$ if and only if $\tilde{\mathbf{y}} = c_1\tilde{\mathbf{v}}_1 + \cdots +
> c_p\tilde{\mathbf{v}}_p$.

The last coordinate of $c_1\tilde{\mathbf{v}}_1 + \cdots +
c_p\tilde{\mathbf{v}}_p$ equals $c_1 + \cdots + c_p$. Matching it to the last
coordinate of $\tilde{\mathbf{y}}$, which is $1$, forces the weights to sum to
$1$, and the first $n$ coordinates reproduce $\mathbf{y} = \sum c_i
\mathbf{v}_i$. The affine constraint $\sum c_i = 1$ has become the single linear
equation "last coordinate equals $1$."

$$
% caption: Homogeneous forms place each point on the copy of $\mathbb{R}^n$ at
% height $1$. An affine combination downstairs is the point where the span of the
% lifted points meets that copy.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
\coordinate (O) at (0,0);
% base line (height 0)
\draw[black] (-0.4,0) -- (5.8,0);
\node[black, anchor=north east] at (5.8,0) {height $0$};
\fill[black] (O) circle (1.4pt) node[anchor=north east] {$O$};
% lifted copy (height 1)
\draw[acc, thick] (-0.4,2.0) -- (5.8,2.0);
\node[acc, anchor=south east] at (5.8,2.0) {height $1$};
\fill[acc] (1.4,2.0) circle (1.7pt) node[anchor=south] {$\mathbf{v}_1$};
\fill[acc] (4.4,2.0) circle (1.7pt) node[anchor=south] {$\mathbf{v}_2$};
\fill[red] (2.6,2.0) circle (1.7pt) node[anchor=south] {$\mathbf{y}$};
% rays from origin through lifted points (the 1-D spans)
\draw[red!60, dashed] (O) -- (2.0,2.9);
\draw[red!60, dashed] (O) -- (5.5,2.5);
\draw[red!60, dashed] (O) -- (3.55,2.73);
\node[red!80, anchor=north west, font=\scriptsize] at (0.3,0.95) {rays through the lifted points};
\end{tikzpicture}
$$

> **Worked example.** Let $\mathbf{v}_1 = (3,1,1)$, $\mathbf{v}_2 = (1,2,1)$,
> $\mathbf{v}_3 = (1,7,0)$, and $\mathbf{p} = (4,3,2)$. Use homogeneous forms to
> write $\mathbf{p}$ as an affine combination of the $\mathbf{v}_i$.
>
> Row reduce $[\,\tilde{\mathbf{v}}_1\; \tilde{\mathbf{v}}_2\;
> \tilde{\mathbf{v}}_3 \mid \tilde{\mathbf{p}}\,]$, moving the row of ones to the
> top to simplify the arithmetic:
> $$
> \begin{bmatrix} 1 & 1 & 1 & 1 \\ 3 & 1 & 1 & 4 \\ 1 & 2 & 7 & 3 \\ 1 & 1 & 0 & 2
> \end{bmatrix}
> \sim
> \begin{bmatrix} 1 & 0 & 0 & 1.5 \\ 0 & 1 & 0 & -1 \\ 0 & 0 & 1 & 0.5 \\ 0 & 0 & 0
> & 0 \end{bmatrix}.
> $$
> The consistent column reads off the weights: $\mathbf{p} = 1.5\mathbf{v}_1 -
> \mathbf{v}_2 + 0.5\mathbf{v}_3$, and $1.5 - 1 + 0.5 = 1$ confirms the affine
> constraint.

Homogeneous coordinates carry into computer graphics, where translations,
rotations, and perspective all become single matrix multiplications in
$\mathbb{R}^{n+1}$. The affine structure of a scene reduces to linear algebra one
dimension up, and the affine hull of a point set is the span of its lifted
copies intersected with the height-$1$ plane. Affine independence — when those
lifted copies are linearly independent — is the subject of
[barycentric coordinates](/linear-algebra/geometry-of-vector-spaces/affine-independence-and-barycentric-coordinates).

[^lay-affine]: **Lay**, _Linear Algebra and Its Applications_, §8.1 — Affine
Combinations: Theorem 1 (affine versus translated linear combinations), Theorem 2
($S = \operatorname{aff} S$), Theorem 3 (affine sets are flats), and Theorem 4
(homogeneous forms). Worked examples adapt §8.1 Examples 1–4.
