Where to get the formulas to calculate planetary positions for a given UTC time value?

AVisitor

Member
I'm writing my own astrology chart software.

Where do I get the formulas to calculate planetary positions for a given time input? Are they published somewhere? I did a search but nothing of substance came up. There are some "ephemeris" tables that don't help me; I don't want tables, I want mathematical input/output formulas.

UPDATE: Site created: www.planetschart.com
 
Last edited:

JUPITERASC

Well-known member
I'm writing my own astrology chart software.

Where do I get the formulas to calculate planetary positions for a given time input? Are they published somewhere? I did a search but nothing of substance came up. There are some "ephemeris" tables that don't help me; I don't want tables, I want mathematical input/output formulas.
pm kaktuzz :)

.
 

kaktuzz

Well-known member
I'm writing my own astrology chart software.

Where do I get the formulas to calculate planetary positions for a given time input? Are they published somewhere? I did a search but nothing of substance came up. There are some "ephemeris" tables that don't help me; I don't want tables, I want mathematical input/output formulas.

It's prety hard to calculate planetary positions on your own (these formulas are pretty crazy and you will never get very precise results)

1) NASA did it pretty precisely - and you can generate/download their JPL ephemeris (daily midnight planet positions at 00:00 UT) from their horizon - https://ssd.jpl.nasa.gov/horizons/app.html#/ ... and then you can use various interpolations to get the position at some particular XX:YY time

2) Or license the swiss ephemeris for programmers - astro.com offers a library/api based on these JPL ephemeris ... which will calculates everything for you https://www.astro.com/swisseph/swephinfo_e.htm
 

AVisitor

Member
Thanks a lot Kaktuzz. (y) Really appreciate it!
I don't think I want to download all those data tables, would be best to use the Swiss API. I would like something like a regular Web Service that produces XML for a given UTC Time Input, but looks like those are C files, so I'd have to find some way to run them.

I already have a basic circle with labels, it was easy to do in PaperJS, but now I need to put points on it:

The idea is, you can type any UTC value you want, and the picture should show the current status. There was a site that used to do this, PlanetWatcher, but it's not available anymore.
 

AVisitor

Member
I looked into that Swiss Ephemeris software, but it's too complicated, and also would force me to run some C commands.

There's actually a NASA Web Service called Horizons which produces a lot of data: https://ssd.jpl.nasa.gov/horizons/app.html#/

I selected 'Mercury' and gave it a date, and out came a large data grid. But does anyone know how to transform that into actual Sign/Degree or Angle info? For example, what does the following tell me?
Date__(UT)__HR:MN R.A._____(ICRF)_____DEC APmag S-brt delta deldot S-O-T /r S-T-O Sky_motion Sky_mot_PA RelVel-ANG Lun_Sky_Brt sky_SNR
2022-Jun-16 00:00 04 01 06.92 +16 58 10.5 0.546 3.749 0.81243538657232 32.5363799 23.1873 /L 106.8729 2.2581585 71.764924 55.720435 n.a. n.a.
 

kaktuzz

Well-known member
But does anyone know how to transform that into actual Sign/Degree or Angle info?

You just need:

5) Table Settings: > Option *31. "Observer ecliptic lon. & lat" (ObsEcLon) :)
https://ssd.jpl.nasa.gov/horizons.cgi

Ecliptic longitude:
00.0 - 30.0 = Aries
30.0 - 60.0 = Taurus
60.0 - 90.0 = Gemini
.
.
.
330.0 - 360.00 (0) = Pisces
 

Attachments

  • EpMfl0UXEAMlpZ32.jpg
    EpMfl0UXEAMlpZ32.jpg
    130.2 KB · Views: 53
  • EpMfgpRXcAAVO_E5.jpg
    EpMfgpRXcAAVO_E5.jpg
    286.8 KB · Views: 57

AVisitor

Member
Is it legal to call this NASA API which can be any number of visits per day? I see on their general API site (not Horizons specifically, but a more general one), https://api.nasa.gov/ , that they have a "Demo Key" for 30 requests/hour, but other uses require an official API key needs to be requested.
if you will be intensively using the APIs to, say, support a mobile application, then you should sign up for a NASA developer key.

I suspect that the author of the previous PlanetWatcher, which was also making these kinds of NASA API requests, got suspended because of legal traffic issues such as this.
 

AVisitor

Member
Everyone, I finally got it all to work now:

planetschart.com


Huge thanks to Kaktuzz for his help, I wouldn't have figured it out on my own. :) This is a usable replacement for the prior PlanetWatcher.com. I cross-checked a few dates and it looks correct, let me know if anything looks wrong. You can try any date. I'm getting data from NASA's Horizons. There are some glitches and potential improvements, so I'm not quite done yet, but will be making them in the near future. Let me know of any issues or comments.
 
Last edited:

AVisitor

Member
Have you guys had a chance to play with the site, any comments? It works on both laptops and mobile devices. I cross-checked a few dates, everything seems to be accurate. Any particular improvements you'd like to see, or any other feedback?
www.planetschart.com <- a replacement for the prior PlanetWatcher, which shows current planetary positions on the astrological wheel for any given timestamp (both now and in the past/future).

In theory I can add an "Equal House" house-based view, as well, which would show the current houses. Placidus would be too complicated, but Equal House is easy: just divide the wheel into 2-hour segments (12 total) starting at midnight.
 
Top