Astronomical Algorithms
Last updated
Was this helpful?
Last updated
Was this helpful?
[WIP]
People who write their own computer programs often wonder why the machine gives inaccurate planet positions, an unreal eclipse track, or a faulty Moon phase. Sometimes they insist, bewildered, "and I used double precision, too." Even commercial software is sometimes afflicted with gremlins, which comes as quite a shock to anyone caught up in the mystique and presumed infallibility of computers. Good techniques can help us avoid erroneous results from a flawed program or a simplistic procedure--and that's what this book is all about.
RA (Right Ascension) to degrees conversion: 1h = 15 degrees
---
Avoid powers in calculations using . Suppose that one wants to calculate the value of the polynomial
It is better to write it as
so that all power functions have disappeared and we only perform additions and multiplications. This is especially well suited for automatic calculation because powers are avoided.
---
Interesting way to exchange two variables X and Y (equivalent to X, Y = Y, X
in Python):