# 2-D Translation Matrix

So, suppose I had the position vector $$\begin{bmatrix}x\\y\end{bmatrix}$$ and I wanted to translate it so that it's tale is at $$\begin{bmatrix}a\\b\end{bmatrix}$$. I know I want my translation matrix yo yield $$\begin{bmatrix}a+x\\b+y\end{bmatrix}$$. However, I'm having trouble coming up with a $$2x2$$ matrix for this. I can come up with the folloiwng $$3x3$$ matrix: $$T=\begin{bmatrix}1 & 0 & a\\0 & 1 & b \\ 0 & 0 & 0\end{bmatrix}$$

Then, multiplying the point $$\begin{bmatrix}x\\y\\1\end{bmatrix}$$ by $$T$$ yields $$\begin{bmatrix}a+x\\b+y\\0\end{bmatrix}$$. However, the best $$2d$$ matrix I could come up with is $$\begin{bmatrix}1 & \frac{a}{y} \\ \frac{b}{x} & 1 \end{bmatrix}$$. Of course, this doesn't work if my position vector is on the $$x$$ or $$y$$ axis. I feel like this should be an easy problem to solve, but I seem to hit a road block. Any suggestions?

• A two dimensional matrix is impossible because the transformation of translation is not linear. Commented Sep 10, 2021 at 15:03

It's not possible to write the transformation you're looking at as a two-dimensional linear transformation. Consider what happens to the zero vector: We know that for any $$2\times 2$$ matrix $$M$$, the we should have $$M\cdot \mathbf{0} = \mathbf{0} \cdot M = \mathbf{0}$$. The trick you've found to augment the vector with an extra column and then use $$3 \times 3$$ matrices instead is exactly one of the standard ways of representing affine transformations.
$$y=Ix+x_0$$
that is $$\begin{bmatrix}a+x\\b+y\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}+\begin{bmatrix}a\\b\end{bmatrix}$$