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 #28169 is a reply to message #28075] Wed, 21 November 2001 07:19 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Martin Downing wrote:
>
> Hi All,
>
> This was an interesting problem - I certainly hadn't noticed it before. The
> reason for the behaviour is precision error in the arithmatic which works
> out the poly2d coefficients. It can be corrected effectively by modifying
> line 128 of rot.pro:
>
> from:
>
> theta = -angle/!radeg ;angle in degrees CLOCKWISE.
>
> to:
>
> theta = (-angle MOD 360) *acos(0.0d)/90 ;angle in degrees CLOCKWISE. (mod
> MRD 21/11/2001 to correct for precision error)
>
> This does two things, firstly (-angle MOD 360) ensures that a precision
> error does not propagate due to large angles which contain multiple 360
> degree rotations,
> for instance that 390.45 degree rotation is treated exactly the same as
> 30.45 degrees [i.e. n*360+theta = = theta].
>
> Secondly, substituting (acos(0.0d)/90) for !radeg gives a full DOUBLE
> precision representation of theta in radians.
>
> This fixes it completely as far as I can see:

Great job!

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
[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:21 PDT 2025

Total time taken to generate the page: 0.00197 seconds