Reflect a point across a line using affine transform

To reflect about the plane $\mathbf{n} (\mathbf{r} - \mathbf{r_0} ) = 0 $, ($\mathbf{n}$ is a unit vector), the affine transformation is

$ T(\mathbf{p}) = \mathbf{r_0} + A (\mathbf{p} - \mathbf{r_0} ) $

where

$T = \mathbf{I} - 2 {\mathbf{n}\mathbf{n}}^T $

In this case, the plane is $y = 7$, so $\mathbf{n} = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}$ and $\mathbf{r_0} = \begin{bmatrix} 0 \\ 7 \\ 0 \end{bmatrix} $

Matrix $A$ is

$A = \begin{bmatrix} 1 && 0 && 0 \\ 0 && 1 && 0 \\ 0 && 0 && 1 \end{bmatrix} - 2 \begin{bmatrix} 0 && 0 && 0 \\ 0 && 1 && 0 \\ 0 && 0 && 0 \end{bmatrix} = \begin{bmatrix} 1 && 0 && 0 \\ 0 && -1 && 0 \\ 0 && 0 && 1 \end{bmatrix}$

Using the formula for reflection,

$T\left(\begin{bmatrix} 6 \\ 12 \\ 0 \end{bmatrix} \right) = \begin{bmatrix} 0 \\ 7 \\ 0 \end{bmatrix} + \begin{bmatrix} 1 && 0 && 0 \\ 0 && -1 && 0 \\ 0 && 0 && 1 \end{bmatrix} \begin{bmatrix} 6 - 0\\ 12 - 7 \\ 0 - 0 \end{bmatrix} = \begin{bmatrix} 6 \\ 2\\ 0 \end{bmatrix} $

Note that I am using the $3D$ coordinates not homogeneous coordinates in $2D$.