0

Possible Duplicate:
How to calculate the mirror point along a line?

In 2D plane, I have a point and a line start and end point.
How to get the mirror point along this line?

Community
  • 1
  • 1
Dumitru
  • 833
  • 3
  • 12
  • 26
  • What exactly do you mean 'mirror point'? The image of your initial point reflected in a mirror defined by the line start and end point? Or something else? – Rup Jul 22 '12 at 10:31
  • Yes. Image of my initial point reflected in a mirror defined by the line start and end point. – Dumitru Jul 22 '12 at 10:33
  • 1
    OK - what you want to do then is to work out the perpendicular vector to your mirror plane (swap the X and Y coordinates and negate one) then compute where a line on that perpendicular starting from your point would intersect the mirror plane, then extend the perpendicular an identical distance past the mirror. There's probably cunning ways you can do this by transforming coordinates too. – Rup Jul 22 '12 at 10:41

1 Answers1

2

You can use the mirror matrix:

enter image description here

This matrix is only for vectors which goes through 0.0 of the coordinate system. Therefore you have to translate the point vector fist. And afterwards translate the vector back.

enter image description here

See wikipedia: Wikipedia Spiegelungsmatrix

The English version can be found here: Wikipedia Coordinate rotations and reflections

Community
  • 1
  • 1
Manuel Amstutz
  • 1,311
  • 13
  • 33