comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: ROT is ROTTEN (a solution)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: ROT is ROTTEN (a solution) [message #28154 is a reply to message #28075] Wed, 21 November 2001 20:55 Go to previous messageGo to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
Martin Downing wrote:

> Regarding the accuracy issue, I can not reproduce your result:
> IDL> a = dist(2048)
> IDL> print,total(rot(a,90)) - total(a)

0.000000

I find that when I add the /DOUBLE keyword to TOTAL()I reproduce your results,
so it does seem like the new rot.pro does produce exact numerical results.
Alternatively,

{ sparc sunos unix 5.4.1 Jan 16 2001 64 64}
IDL> a = dist(2048)
IDL> print,array_equal( rotate(a,1), rot(a,-90) )
1

(I had also forgotten that ROTATE() is positive counterclockwise and ROT() is
positive clockwise.

> This was an issue of general rotations which was just well illustrated by 90
degree examples.

I could be wrong again ;-), but I think that the original ROT had no problems
except at exact multiples of 90 degrees. It doesn't matter if a rotation
angle of 23 degrees loses precision and becomes 23.00001 degrees, but it does
matter if 90 degrees becomes 90.00001 degrees. At 90 degrees the new image
exactly overlaps the old image, and there is no need to extrapolate, but at
90.000001 degrees there will be subpixels on the edge of the new image that do
not overlay the old (and which will be flagged as missing data).

Wayne Landsman landsman@mpb.gsfc.nasa.gov

b= findgen(3,3)
IDL>print,rot(b,90)
2.00000 5.00000 8.00000
1.00000 4.00000 7.00000
0.00000 3.00000 6.00000
IDL> print,rot(b,90.0001)
2.00000 5.00000 7.00000
1.00000 4.00000 7.00000
0.00000 0.00000 3.00000
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Time on My Hands
Next Topic: Event Handling

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:00:22 PDT 2025

Total time taken to generate the page: 0.00438 seconds