View Full Version : Matrix for reflecting points on the line y=x

10-29-2008, 03:10 PM
Is there are a matrix for this? I've been trying to come up with something, seems impossible to me.

10-29-2008, 03:51 PM
Could you be more specific??

If you are thinking in a 3D space, it is not line but a plane.

And in what is it related to OpenGL? you should at least ask your question on the math section.

10-29-2008, 04:00 PM
If you search the matrix for the linear function that maps (x,y) to (y,x) then the 2D matrix is
(0 1)
(1 0)

10-29-2008, 04:47 PM
I was going to put it in the math section, but I figured I want to understand the matrix and it is probably going to be a shear function of some sort.

So that matrix you've given is in fact a shear function


I can't really understand how this would move and object as there very very little on shearing on the net lol, but I'll try it out, thanks.

10-30-2008, 03:54 AM
Actually it is a simple permutation matrix that swaps x and y.

10-30-2008, 09:06 AM
true, any axis swap (*= -1.0) is mirroring/reflecting to the opposite side.