Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rotate a Matrix

Status
Not open for further replies.

Optiker

Technical User
Aug 24, 2005
2
US
I have a matrix of values (180 X 220) representing surface heights from a CCD. The data is rotated ( anywhere from -3 to + 15 degrees) and I need to rotate it back so the surface heights line up with the ccd axes. The rotation is strictly around the z axis and is data-centric ( rotates around the center of the data). Any ideas?
Bill
 
Can you tell me what kind of thing you are expecting for those cells near the origin?

for example, let's suppose that the numbers 5's and 8's are the centre 4 cells of the matrix. What would expect a rotation of 15 degrees to result in?
[1][2][3][2]
[4][5][5][4]
[7][8][8][7]
[6][9][9][6]


Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
I would expect there would need to be an expansion of the matrix, and interpolation between the phase values. For the case of 45 degrees:

0 degrees

[1][2][3][2]
[4][5][5][4]
[7][8][8][7]
[6][9][9][6]

45 degrees

[2]
[3] [4]
[2] [5] [7]
[1] [5] [8] [6]
[4] [8] [9]
[7] [9]
[6]
(sorry, looked OK with notepad -- should be symmetrical diamond shaped matrix)

I would expect the relationship of the values to each other to remain the same.
 
Yes, Optiker, I see what 45 degrees anticlockwise would look like, and I'd already worked that out. But what happens for amounts less than a multiple of 45 degrees. You could work out co-ordinates for those parts of the matrix well away from the origin, where the change might result in a shift that matches a good fit for cell location, but what about those cells near the origin?



Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top