I want to find a 3x3 Matrix that reflects in an Arbitrary Line y=mx+c I have a matrix with me but it doesnt take into account the '$c$'
This is the matrix
\begin{pmatrix} \frac{1-m^2}{m^2+1}& \frac{2m}{m^2+1}& 0 \\ \frac{2m}{m^2+1}& \frac{m^2-1}{m^2+1}& 0 \\ 0& 0& 1 \\ \end{pmatrix}
The problem I have with this matrix is that i it reflects from the origin with the function $y=mx$ It doesnt take it in the $y-intercept$ factor.
So i would have to translate it to the origin then find the reflection using the above matrix then translate it back to the $y-intercept$
But is there One matrix that does everything. A 3x3 matrix that reflects in an arbitrary line $y=mx+c$. Which takes in all factors.
Edit This is what Ive been working on. The matrix that reflects in an Aritrary Line Here
But I cant seem to get the expected answer. Ive used matrix calculators online and ive done it manually and i dont know why im getting the wrong answer. When i mean wrong answer. It means the negative symbols are there when they're not supposed to be.
This is the Expected Answer
Below is the answer from a matrix calculator from online
tinyurl.com/n9njqfm
Let $M$ be the matrix of the reflection through the line $y=mx$, above. To get the reflection through $y=mx+c$, translate to the origin, reflect by $M$, and then translate back: $$ \pmatrix{1 & 0 & 1 \\ 0 & 1 & c \\ 0 & 0 & 1}M\pmatrix{1 & 0 & 1 \\ 0 & 1 & -c \\ 0 & 0 & 1} = \pmatrix{ \frac{1-m^2}{1+m^2} & \frac{2m}{1+m^2} & -\frac{2mc}{1+m^2} \\ \frac{2m}{1+m^2} & -\frac{1-m^2}{1+m^2} & \frac{2c}{1+m^2} \\ 0 & 0 & 1}. $$ With $m=\frac12$ and $c=2$, this yields the Expected Answer.