# what is the difference between linear transformation and affine transformation?

Recently, I am struglling with the difference between linear transformation and affine transformation. Are they the same ? I found an interesting question on the difference between the functions. But still, not very clear.

• Every linear transformation $f$ is an affine transformation such that $f(0)=0$. – Surb Dec 9 '14 at 13:50
• @Surb, Can we discuss based on set ? – guanglei Dec 9 '14 at 13:53
• what do you mean by "based on set"? – Surb Dec 9 '14 at 13:54

A linear transformation is any transformation $f:U\to V$ between vector spaces over $\mathbb F$ for which

• $f(x+y)=f(x)+f(y)$
• $f(\alpha x) = \alpha f(x)$

for all $x,y\in U$ and all $\alpha\in\mathbb F$.

An affine transformation is any transformation $f:U\to V$ for which, if $\sum_i\lambda_i = 1$, $$f(\sum_i \lambda_i x_i) = \sum_i \lambda_i f(x_i)$$ for all sets of vectors $x_i\in U$.

In effect, what these two definitions mean is:

1. All linear transformations are affine transformations.
2. Not all affine transformations are linear transformations.
3. It can be shown that any affine transformation $A:U\to V$ can be written as $A(x) = L(x) + v_0$, where $v_0$ is some vector from $V$ and $L:U\to V$ is a linear transformation.

Take an example where $U=V=\mathbb R^2$. Then $$f:(x,y) \mapsto(-2x+y, 3x+8y)$$ is a linear transformation, since

$$f((x_1,y_1)+(x_2, y_2)) = (-2(x_1+x_2) + y_1+y_2, 3(x_1+x_2) + 8(y_1+y_2)) = \\ = (-2x_1 + y_1, 3x_1 + 8y_1) + (-2x_2 + y_2, 3x_2 + 8y_2) = f((x_1,y_1)+f((x_2, y_2))$$

However, $$g:(x,y)\mapsto (-2x+y+5, 3x+8y-2)$$ is not a linear function (you can immediatelly see this since $g((0,0)) \neq (0,0)$, while linear functions always map $0$ to $0$).

Both $g$ and $f$ are (you can check) affine functions.

• Maybe $\sum_{i}\lambda_i = 1$. – guanglei Dec 9 '14 at 14:05
• @guanglei You are correct. Thank you. – 5xum Dec 9 '14 at 14:06
• @5xum I think this is false $$f(\sum_i \lambda_i x_i) = \sum_i \lambda_i x_i$$ – GhD Jan 15 '18 at 10:25
• it should be $$f(\sum_i \lambda_i x_i) = \sum_i \lambda_i f(x_i)$$ – GhD Jan 15 '18 at 10:26
• Interpretation of the formula is that affine transformation preserves mass centres of sets (i.e., barycenters). You can think of $\lambda_i$ as weights and $x_i$ as a set of objects. The mass centre of the set ${x_i}_{i=1}^n$ is $\sum_{i=1}^n \lambda_i x_i$. Then the main formula boils down to mass centre of the set is mapped to the mass centre of the map of the set – Fibo Kowalsky Jul 28 '20 at 13:44

An alternative point of view is that, given any vector space $V$, we extend it by one dimension by including a new nonzero vector $o$ and also all linear combinations of it and the existing vectors. Call this new vector space, an affine space and denote it $a(V,o)$. Call the elements of $V+o$ points of the affine space and any nonzero vector is a scalar multiple of some point which we call a weighted point where the scalar is the weight of the point. Now if a linear map between two affine spaces $f: a(V_1,o_1) \to a(V_2,o_2)$ satisfies $f(V_1)\subset V_2$ and $f(o_1) = v_2 + o_2$ where $v_2\in V_2$, then we call it an affine map. That is, we require this because we want points to map to points. You can check that composition of affine maps is affine and $f(v_1 + o_1) = (f(v_1) + v_2) + o_2$. This is like the usual $y=mx+b$. Think of the vector $o$ as a bookkeeping device to keep track of an origin. That is, in a vector space there is a unique zero vector, but in an affine space, all points can be regarded effectively as an origin. If $f(o_1) = o_2$ then $v_2=0$ and $f$ is just a linear map just like $y=mx$. So all affine maps are linear but not vice versa.

Let $V,W$ be some $\Bbb K$ vector space.

• $f:V \to W$ is linear if for every $\alpha,\mu\in \Bbb K$ and $v_1,v_2\in V$ we have $f(\alpha v_1+\mu v_2) = \alpha f(v_1)+\mu f(v_2)$.

• $g:V\to W$ is affine if there exists $b\in V$ such that $\tilde g:V\to W:v \mapsto g(v)-b$ is linear.

• In particular every linear transformation is affine (choose $b=0$) but the reverse is not true. – Surb Dec 9 '14 at 13:57
• Thanks @Surb. Now I got it. What I mean is as follows: – guanglei Dec 9 '14 at 14:08