# Affine hull vs. convex hull

The affine hull and convex hull are closely related concepts. Let $S$ be a set in $\mathbb{R}^n$. The affine hull of $S$ is the set of all affine combinations of elements of $S$: \begin{aligned} \text{aff}(S) = \left\{ \sum_{i=1}^k a_i x_i : k > 0, x_i \in S, a_i \in \mathbb{R}, \sum_{i=1}^k a_i = 1 \right\}. \end{aligned}

The convex hull of $S$ is the set of all convex combinations of the elements of $S$: \begin{aligned} \text{conv}(S) = \left\{ \sum_{i=1}^k a_i x_i : k > 0, x_i \in S, a_i \in \mathbb{R}, a_i \geq 0, \sum_{i=1}^k a_i = 1 \right\}. \end{aligned}

Putting the definitions side by side, we see that the only difference is that for the convex hull, the weights in the linear combination (the $a_i$‘s) have an additional restriction of being non-negative. The only restriction on the $a_i$‘s for combinations in the affine hull is that they sum to 1. This also means that the affine hull always contains the convex hull.

Let’s have a look at a few examples. If $S$ consists of two points, the convex hull is the line segment joining them (including the endpoints) while the affine hull is the entire line through these two points: For 3 non-collinear points in two dimensions, the convex hull is the triangle with these 3 points as vertices while the affine hull is the entire plane $\mathbb{R}^2$: The final illustration below shows the affine and convex hulls of 3 non-collinear points in $\mathbb{R}^3$. They are both two-dimensional sets living in 3-dimensional space. Notice also how the affine hull need not pass through the origin (whereas all subspaces of $\mathbb{R}^3$ must pass through it). 