Determine homogeneous transformation matrix for reflection about the line $y = mx + b$, or specifically $y = 2x - 6$ Determine the homogeneous transformation matrix for reflection about the line
$y = mx + b$,  or specifically $ y = 2x - 6$.

I use  $mx - y +b =0$:  $\text{slope} = m$,  $\tan(\theta)= m$
intersection with the axes:
$x =0$  is $y = -b$   and  $y =0$ is  $x = \dfrac{b}{m}$
My question is, what  can I do next?
Write down the transform in vector form and you can derive it from scratch. The line can be written as $mx-y=-b$. The normal to the line is $\vec{n}=(m,-1)$. Let's also introduce some initial point on the line -- let's say $\vec{r}_0=(x,y)=(0,b)$. How do you reflect about a line through the center? Easy - subtract twice the projection to the normal. How about if it's not through the center? Move to the center, transform, and move back. The transform is:

$$\vec{r} \mapsto (\vec{r}-\vec{r}_0)-2\hat{n}( \hat{n}\cdot(\vec{r}-\vec{r}_0))+\vec{r}_0$$
I normalized the normal, $\hat{n}=\frac{\vec{n}}{|n|}=\frac{(m,-1)}{\sqrt{m^2+1}}$.

This can be simplified to:
$$\vec{r}-2\hat{n}( \hat{n}\cdot\vec{r})-2\hat{n}( \hat{n}\cdot\vec{r}_0)$$
The first two terms are the standard reflection matrix in 2D and represents the 2×2 block of your homogeneous 3×3 matrix. The last term is the offset that contributes to both components of the result, and is in the homogeneous coordinates obtained from the last column (which multiplies the constant third coordinate).

Observe that because $\vec{r}_0$ is on the line, it satisfies the original equation $\vec{n}\cdot\vec{r}_0=-b$, so our choice of the origin point is irrelevant.

Now, you can simply write the matrix out:

$$\begin{bmatrix}x'\\y'\\1\end{bmatrix}=\begin{bmatrix}1-2n_x^2/|n|^2 &amp; -2n_xn_y/|n|^2 &amp; 2n_xb/|n|^2 \\ -2n_xn_y/|n|^2 &amp; 1-2n_y^2/|n|^2 &amp; 2n_yb/|n|^2 \\0 &amp; 0&amp; 1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}$$

In our specific case:
$$\begin{bmatrix}1-2m^2/(m^2+1) &amp; 2m/(m^2+1) &amp; 2mb/(m^2+1) \\ 2m/(m^2+1) &amp; 1-2/(m^2+1) &amp; -2b/(m^2+1) \\0 &amp; 0&amp; 1\end{bmatrix}$$



You can see it's way easier, if you use the canonical implicit form for the line. If you have
$$ax+by=c$$
where $a^2+b^2=1$, then the matrix simplifies to
$$\begin{bmatrix}1-2a^2 &amp; -2ab &amp; -2ac \\ -2ab &amp; 1-2b^2 &amp; -2bc \\0 &amp; 0&amp; 1\end{bmatrix}$$
or, if you want, $I-2(a,b,0)^T(a,b,c)$.
Note that any matrix $\mathbf A\cdot \vec{0}=\vec{0}$, so there is no matrix that can flip over $y=2x-6$ as it must map $\vec 0 \to (4 \frac{4}{5},-2\frac{2}{5})$.  You might want to do something about that.