# Thread: Matrix for reflecting points on the line y=x

1. ## Matrix for reflecting points on the line y=x

Is there are a matrix for this? I've been trying to come up with something, seems impossible to me.

2. ## Re: Matrix for reflecting points on the line y=x

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.

3. ## Re: Matrix for reflecting points on the line y=x

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)

4. ## Re: Matrix for reflecting points on the line y=x

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

010
100
001

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.

5. ## Re: Matrix for reflecting points on the line y=x

Actually it is a simple permutation matrix that swaps x and y.

6. ## Re: Matrix for reflecting points on the line y=x

true, any axis swap (*= -1.0) is mirroring/reflecting to the opposite side.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•