A function $f: \mathbf{R}^n \to \mathbf{R}^m$ is affine if it is a sum of a linear function and a constant ($f(x) = Ax + b$).
A set $S \subseteq \mathbf{R}^n$ is affine if for any $x_1,x_2 \in S$ and $\theta \in \mathbf{R}$ we have $\theta x_1 + (1-\theta)x_2 \in S$.
Can someone explain the relationship between these two ideas?