CruiserOne / Astrolog

The astrology software "Astrolog", version 7.70
http://www.astrolog.org/astrolog.htm
Other
171 stars 65 forks source link

Core Astroscience prediction formula #22

Closed HolyNameSoftware closed 1 month ago

HolyNameSoftware commented 2 months ago

I look to develop my own timepiece and here "shopping" around for sourcecode. What I need is the formula for predictions which I can use to predict the appearance of the Sun as it should be seen in the sky. I read on WikipediA Astrolog can do this: Astrolog can calculate current planetary positions in sidereal, traditional, and heliocentric formats. Will you show me around the code and give me a pointer as to what parts have enabled the planetary position predictions. I will be looking into porting the formula of calculations into my own software so the C++ language isn't a matter. This would be mostly math.

CruiserOne commented 1 month ago

In Astrolog, planetary zodiac positions are calculated in the function swe_calc() in the file sweph.cpp. This is the Swiss Ephemeris library which Astrolog is using, which can be read about more at https://www.astro.com/swisseph/swephprg.htm. If you want to know where a planet appears in the sky in the local horizon (e.g. rising/setting), Astrolog does that in ChartHorizon() in charts1.cpp (text version), and in XChartHorizon() in xcharts1.cpp (graphics version).