For a point $(x, y)$ in the plane $\mathbb{R}^{2}$, define $T(x, y)$ to be the point on the line $\ell = \{(x, y) \in \mathbb{R}^{2} \mid y = 2x\}$ that is closest to $(x, y)$. Show that the mapping is linear, and find the $2\times 2$ matrix associated with this mapping.
I know how to prove a function is linear, but I'm not sure about how to find this matrix. I tried plugging in "test points" to determine values of the function. For example, $(0, 0)$ should map to $(0, 0)$. Can someone help me please?
Hint: You are given a point $(x,y)$ and you want to find the point $(w,2w)$ closest to it. In other words, you want to pick $w$ such that $$ \left\Vert (w,2w)-(x,y)\right\Vert ^{2} =\left(w-x\right)^{2}+\left(2w-y\right)^{2} $$ is minimized. To do so, take the derivative of the above with respect to $w$, set it to zero, and solve for $w$. What do you see?