How to find the coordinates of the reflection of the point $(0,1)$ in the line $y=mx$? So I understand the perpendicular line is $y=-\frac{1}mx+c$ and I think the point of intersection is $(\frac{-1+m}{m^2}),(\frac{-1+m}{m^3}+c)$ based on my calculation but I think I have made an error. Any help is greatly appreciated
 A: Let $d_1$ be a line defined by the equation $y = mx$ and $d_2$ the line perpendicular to $d_1$ and passing through $(0,1)$. Consider the case $m \neq 0.$
Since $d_2 \perp d_1$ the angular coefficient of $d_2$ is $-\frac 1 m $ so $d_2$ has the following equation
$$ y = - \frac 1 m x + c$$
where $c = 1$ since $(0,1)$ is a point of $d_2$. The intersection of the two lines is the solution of the system of equations
$$ 
\begin{cases} y = - \frac 1 m x +1\\
y =  mx.\end{cases}
$$
By substitution $mx = - \frac 1m x + 1 \iff (m+\frac 1 m)x = 1 \iff \frac{m^2 + 1}{m}x = 1 \iff x = \frac{m}{m^2 + 1}.$ So the intersection of the two lines is the point
$$ P = (\frac{m}{m^2+1}, \frac{m^2}{m^2 + 1}) $$
Let $A = (0,1)$ and $A'$ the reflection of $(0,1)$ along the line $y = mx$ then we must have $ \vec{PA} = - \vec{PA'}$. This means that
$$ \vec{OA'} = \vec{OP} + \vec{PA'} = \vec{OP} - \vec{PA}$$
but $ \vec {PA} = \vec {OA} - \vec {OP}$ and we have
$$ \vec{OA'} = 2\vec{OP} - \vec{OA}.$$
Therefore $$A'  = (2 \frac{m}{m^2 + 1},2 \frac{m^2}{m^2+1} -1).$$
A: Here I propose an alternative solution based on linear algebra.
Let us consider the linear transformation $T:\textbf{R}^{2}\to\textbf{R}^{2}$ be a the linear transformation given by the reflection along the line $y = mx$. Then one hast that $T(1,m) = (1,m)$ and $T(-m,1) = (m,-1)$.
Thus if we consider the basis $\mathcal{B}' = \{(1,m),(-m,1)\}$, it results that
\begin{align*}
[T]_{\mathcal{B}'} =
\begin{bmatrix}
1 & 0\\
0 & -1\\
\end{bmatrix}
\end{align*}
Now let us consider the standard basis of $\textbf{R}^{2}$: $\mathcal{B} = \{(1,0),(0,1)\}$. Then one has that
\begin{align*}
[T]_{\mathcal{B}} = [T]_{\mathcal{B}'}^{\mathcal{B}}[T]_{\mathcal{B}'}[T]_{\mathcal{B}}^{\mathcal{B}'}
\end{align*}
Then it remains to determine the matrices $[T]_{\mathcal{B}'}^{\mathcal{B}}$ and $[T]_{\mathcal{B}}^{\mathcal{B}'}$. To begin with, notice that
\begin{align*}
[T]_{\mathcal{B}'}^{\mathcal{B}} = 
\begin{bmatrix}
1 & -m\\
m & 1
\end{bmatrix} \Rightarrow
[T]_{\mathcal{B}}^{\mathcal{B}'} = ([T]_{\mathcal{B}'}^{\mathcal{B}})^{-1} =
\frac{1}{1+m^{2}}
\begin{bmatrix}
1 & m\\
-m & 1
\end{bmatrix}
\end{align*}
Finally, if we denote $(0,1)$ by $v$, one has that
\begin{align*}
[T]_{\mathcal{B}} =
\frac{1}{1+m^{2}}
\begin{bmatrix}
1-m^{2} & 2m\\
2m & m^{2}-1
\end{bmatrix} \Rightarrow [Tv]_{\mathcal{B}} = [T]_{\mathcal{B}}[v]_{\mathcal{B}} = \left(\frac{2m}{m^{2}+1},\frac{m^{2}-1}{m^{2}+1}\right)
\end{align*}
Hopefully this helps.
