[amsat-bb] Re: use of PI in amsat development practice

Howard Long howard at howardlong.com
Mon Mar 15 08:30:52 PDT 2010


> What an interesting question! As many of you know, I'm having fun
> porting the G3RUH's Plan13 algorithm to the Atmel platform. One of the
> first things you want to be able to do in programs like this is to
> convert degrees to radians; and that means pi.

FWIW I used 32 bit accuracy (equivalent to IEEE754 single precision) in my
PIC LVB Tracker 2 code (based on G3RUH Plan13 too) without any significant
difference in results over 64 bit. Although the accuracy did cause some
anomalies, they were small and inconsequential for amateur purposes,
typically a second or two in predictions. I tested this by running the same
code on a PC and carefully coding constants, stored values and datatypes
with #defines so I could recompile on demand and see the differences in the

I was lucky, ISTR I had 3.5KB, but even that was a struggle, although I did
have the additional dimension of having to deal with manual bank switching
too of the PIC18 - you might not have this on your device. And the compiler
I used, although generating very compact code, wouldn't compile anything
slightly complex, so I had to manually split the statements into simpler

If I did it again, I'd head for at least a 16 bit and probably a 32 bit
device, and a different compiler. But five plus years ago we didn't have
such devices or capabilities!

73, Howard G6LVB

More information about the AMSAT-BB mailing list