# Image of a point reflected over $y=mx+b$ using dot product

So, I know that the image for a generic point is $$\small((1-m^2/1+m^2)x + (2m/1+m^2)(y-b), (2m/1+m^2)x - (1-m^2/1+m^2)(y-b)+b))$$ when you reflect it over the line $y=mx+b$. It's straightforward enough to derive that with complex mappings.

I need to derive the same result using the dot product and the projection of vectors in $\mathbb{R}^2$. I'd really appreciate any help on this, thanks!

-
By "$(1-m^2/1+m^2)$", did you mean $(1-m^2)/(1+m^2)$? ${}\qquad{}$ –  Michael Hardy May 11 '14 at 1:53

Your line can be written as $$l(t)=(0,b)+t(1,m)$$ In other words, it is the linear space of $(1,m)$, offset by $(0,b)$. To reflect $(x,y)$ across $l(t)$, it is enough to find the orthogonal projection of $(x,y)$ onto a point $l(t)$ on the line and then to extend $$(x,y)+2(l(t)-(x,y)).$$ The point $l(t)$ is chosen so that $l(t)-(x,y)$ is orthogonal to the direction vector $(1,m)$: $$\left\{(0,b)+t(1,m)-(x,y)\right\}\cdot(1,m)=0.$$ So, $$mb+t(1+m^{2})-x-my=0,\\ t = \frac{x+m(y-b)}{1+m^{2}}.$$ The projection is $$(x,y)+2(l(t)-(x,y)) =\\ = (x,y)+2\left\{(0,b)+\frac{x+m(y-b)}{1+m^{2}}(1,m)-(x,y)\right\}\\ = \left(2\frac{x+m(y-b)}{1+m^{2}}-x,2b+2\frac{x+m(y-b)}{1+m^{2}}m-y\right)\\ = \left(\frac{1-m^{2}}{1+m^{2}}x+\frac{2m}{1+m^{2}}(y-b), \frac{2m}{1+m^{2}}x-\frac{1-m^{2}}{1+m^{2}}(y-b)+b\right)$$