views:

6

answers:

0

My former math teacher is going to eat me, but I was unable to solve this. I've got the x-y-coordinates of 2 reference points in 2 coordinate systems. For instance:

  • A: System 1: x=2, y=3; System 2: x=5, y=-2
  • B: System 1: x=4, y=0; System 2: x=-8, y=1

Using these as reference, I would like to convert the coordinates from system 1 to system 2. As a really simple example, the coordinates 2;3 in system 1 are obviously mapped to 5;-2 in system 2. alt text

I understand that I have to translate, scale and rotate, and that I could probably use a matrix for that, but I've been out of school for a few years. My math skills went poof and I could not come up with a working solution.

This is not a homework question, I'd be glad if you could assist me and point me in the right direction. I do not mind complete solutions (is there possibly code for this available already? Google did not show anything useful to me), but I'm still happy with a quick math hint as well.