# Representing affine map in matrix-vector form

A map $T$ is affine if $T(\sum_{i=1}^n\lambda_i x_i) = \sum_{i=1}^n \lambda_i T(x_i)$ whenever $\sum_{i=1}^n \lambda_i = 1$. I can see that every affine map can be expressed in the form $T(x) = Ax + T(0)$ for some matrix $A$. My course notes state that this matrix can be expressed as $A = (T(e_1), T(e_2), \ldots, T(e_n))$; i.e. the $i$th column of the matrix is $T(e_i)$.

My confusion arises from this definition of $A$. Clearly $Ae_i = T(e_i)$ for all $i$, so we have $T(0) = T(x) - Ax = T(e_1) - Ae_1 = 0$, when clearly not all affine maps map the origin to itself (which is why they are affine and not linear!). Are my notes mistaken about the composition of matrix $A$, or am I missing something obvious?

You are right. $A = (T(e_1), T(e_2), \ldots, T(e_n))$ is true only for linear maps. For an affine map it should be $$A = (T(e_1)-T(0), T(e_2)-T(0), \ldots, T(e_n)-T(0)).$$ P.S. Basically, the idea is to notice that the map $L(x)=T(x)-T(0)$ is linear and apply the standard matrix construction to it.