Dear Stellarium developers,
I am using Stellarium for long time and now i wish to understand how sky mechanic works. I am looking over the internet, but I cannot find any computation formulas. Where I can learn them? Only one thing i found is that in every cases i had to compute with Julian date. But how to compute, where is now Sun relative to Earth or Mars or Saturn etc. I cannot found. Isn't it secret? :-)
You seem to have CSS turned off.
Please don't fill out this field.
The formula for making astronomical calculations have been available for a long time.
I use a book (out of print ?) called "astronomy with your personal computer" by Peter Duffet-Smith. This book explains the formula and give working examples written in BASIC that can be assembled into programs to calculate all the info you need.
See also: Astronomy on the Personal Computer by O. Montenbruck and T. Pfleger
Astronomical Algorithms by J. Meeus
If you want to see how they are used in scripts, download my ephemeris scripts at
In the script file (open with Notepad) I calculate all the ephemeris (i.e. elongation, ra, dec, phase) for each planet (as opposed to reading them "directly" from Stellarium).