Cartesian coordinate transformation (rotation & scaling)

Balsiefen

New member
Joined
Jun 29, 2016
Messages
3
Hi all, I've come across a monster of a coordinate transformation in the course of my work and I'd be grateful if someone could give it a look over.

I have two coordinate systems: ( x, y ) and ( x', y' ) that have been scaled by factor 'S', and rotated by angle ', about the point ( a, b ) = ( a', b' ). Neither of these transformations is about the origins of the axes.

I need to be able to transform from both ( x, y ) to ( x', y' ) and back again.



My best guess for the forward transformation is

x' - a' = S{ (x-a)cosθ - (y-b)sinθ } and

y' - b' = S{ -(x-a)sinθ + (y-b)cosθ }

However, I have no idea if this is right and I'm unsure as to what the reverse transformation would be.


Thanks for any help!
 
Hi all, I've come across a monster of a coordinate transformation in the course of my work and I'd be grateful if someone could give it a look over.

I have two coordinate systems: ( x, y ) and ( x', y' ) that have been scaled by factor 'S', and rotated by angle ', about the point ( a, b ) = ( a', b' ). Neither of these transformations is about the origins of the axes.

I need to be able to transform from both ( x, y ) to ( x', y' ) and back again.



My best guess for the forward transformation is

x' - a' = S{ (x-a)cosθ - (y-b)sinθ } and

y' - b' = S{ -(x-a)sinθ + (y-b)cosθ }

However, I have no idea if this is right and I'm unsure as to what the reverse transformation would be.


Thanks for any help!
Write the transformation equations in a matrix form.

Do you know how to calculate inverse of a matrix?

You could also treat the equations as simultaneous equations with two unknowns (x',y') and solve it.
 
Write the transformation equations in a matrix form.

Do you know how to calculate inverse of a matrix?

You could also treat the equations as simultaneous equations with two unknowns (x',y') and solve it.

Thanks, I think I've got it in that case. (Assuming my first eqn is correct)
 
Coordinate transformation

Hi all, I've come across a monster of a coordinate transformation in the course of my work and I'd be grateful if someone could give it a look over.

I have two coordinate systems: ( x, y ) and ( x', y' ) that have been scaled by factor 'S', and rotated by angle ', about the point ( a, b ) = ( a', b' ). Neither of these transformations is about the origins of the axes.

I need to be able to transform from both ( x, y ) to ( x', y' ) and back again.



My best guess for the forward transformation is

x' - a' = S{ (x-a)cosθ - (y-b)sinθ } and

y' - b' = S{ -(x-a)sinθ + (y-b)cosθ }

However, I have no idea if this is right and I'm unsure as to what the reverse transformation would be.


Thanks for any help!


This is almost correct; we just need to fix a minus sign. I am not sure which direction you want to rotate, but one way is to write

x' - a' = S{ (x-a)cosθ - (y-b)sinθ } and

y' - b' = S{ (x-a)sinθ + (y-b)cosθ }

Then the reverse transformation will be

x - a =(1/S){ (x' - a' )cosθ + (y' - b' )sinθ } and

y- b=(1/S){ -(x' - a' )sinθ + (y' - b' )cosθ }

Let's look at a special case: a=a'=0=b=b', S=1, θ=pi/2

Then x'=-y and y'=x. This is a 90 degree rotation around the origin, but I am not sure which direction. It depends on the meaning of the two coordinate systems. You can decide if this is what you want; just switch the coordinate systems if you want the rotation to go the other way.

 
Thank you, hadn't spotted the minus sign there. Think I've got the bugger working now. :)

attachment.php

It's pretty though no?
 

Attachments

  • 1342202254-herschel.ia.obs.ObservationContext-829295.jpg
    1342202254-herschel.ia.obs.ObservationContext-829295.jpg
    134.4 KB · Views: 7
Top