Dilation about a point (a,b), but not about the origin I recently had a question on a test that asked me to modify the transformation (where r is a scalar of sorts)
$D(x,y) = D(rx,ry)$
so that I could use any arbitrary point $(a,b)$. I am quite sure I didn't do it correctly. I got that for a dilation about the origin
$D(x,y) = (rx,ry)$ by 
$$ \left[
  \begin{array}{ c c }
     r & 0 \\
     0 & r
  \end{array} \right]
\left[
  \begin{array}{c}
     x \\
     y
  \end{array} \right]
$$
and also proved that the dilation equation for some $(x_{1},y_{1})$ and $(x_{2},y_{2})$ is
$|r|\sqrt{(x_{1}-x_{2})^2 + (y_{1}-y_{2})^2}$
For any point $(a,b)$, would it be enough to just simply plug in $(a,b)$? Then the new dilation transformation would be
$D(a,b) = D(ra,rb)$ by 
$$ \left[
  \begin{array}{ c c }
     r & 0 \\
     0 & r
  \end{array} \right]
\left[
  \begin{array}{c}
     a \\
     b
  \end{array} \right]
$$ 
I am quite lost at how to go about modifying the original transformation for a dilation about the origin and am sure I am going about this wrong and thus got it wrong in my test. This is for a higher level college math course and again, cannot for the life of me come up with a strategy to figure this out. 
 A: In general, if you have a linear transformation $L$, you can create the affine transformation $L_{\mathbf p}$ that is “$L$ centered at $\mathbf p$” by translating the origin to $\mathbf p$, applying $L$, and then translating back. That is, $$L_{\mathbf p}(\mathbf v)=L(\mathbf v-\mathbf p)+\mathbf p.$$ Applying this to your dilation with $\mathbf p=(a,b)$ gives us $$D_{(a,b)}(x,y)=(r(x-a)+a,r(y-b)+b).$$  
In general, any affine transformation can be decomposed into a linear transformation followed by a translation, i.e., $A(\mathbf v)=L(\mathbf v)+\mathbf t$ for some linear $L$ and fixed vector $\mathbf t$. If $\mathtt M$ is the matrix of $L$, then we can write $A(\mathbf v)$ in matrix form as $$A(\mathbf v) = \left[\begin{array}{c|c}\mathtt M & \mathbf t\end{array}\right]\begin{bmatrix}\mathbf v\\1\end{bmatrix}.$$ This is a simple example of the use of homogeneous coordinates. We can apply this idea to get a matrix for $L_{\mathbf p}$. Observe that by linearity $L(\mathbf v-\mathbf p)+\mathbf p=L(\mathbf v)+(\mathbf p-L(\mathbf p))$, therefore the matrix of $L_{\mathbf p}$ is $$\left[\begin{array}{c|c}\mathtt M & \mathbf p-\mathtt M\mathbf p\end{array}\right].$$ Applying this to the dilation produces $$\begin{bmatrix}r&0 & (1-r)a \\ 0&r & (1-r)b\end{bmatrix}.$$ You can verify for yourself that multiplying $(x,y,1)^T$ by this matrix gives the same result as the formula for $D_{(a,b)}$ above.
