Tutorial :Astronomy API or other means of charting the positions of the planets? [closed]


I am interested in charting the positions of the planets. What are some APIs and other means of accomplishing this on Mac OS X?


If you want raw vector astrometry, then you can have a look at the US Naval Observatory Vector Astrometry Subroutines (NOVAS). Source code is available in C and Fortran, someone has also ported it to Python and I'm currently working on a C# port. The NOVAS routines support calculating positions of the major and minor planets and stars.

You can find the source code at the US Naval Observatory website.


The NAIF SPICE Toolkit is available for several platforms and several languages. It's incredibly useful and stable. It's also used in past, present and future space exploration missions, like NASA and ESA stuff. Want to know where Neptune is right now? No problem. Want to know where you should point your telescope to see Neptune because the light reaching is from there was where Neptune used to be? Still no problem. Not only is this used in actual space exploration, it's also used by Celestia and other popular software.


On C my best recommendation is the code by S. L. Moshier. As an astronomer I use Java and I'm developing a library called JPARSEC, that uses among others the algorithms by Moshier with great results.


The closest I've seen to this is the Google Sky API:


It might take a bit of digging to get what you need out of it but I have an application on my google phone that based on the location of the phone and it's orientation, plots the planets and stars on screen. You'd have to query their web services from your application but it has the side-effect that it is then platform independent.

See the following for an example app:



If you're interested, have a look at my VSOP87 C API to see if what I've begun is suitable for your needs. The VSOP87 library is complete, I just haven't completed the Doxygen documentation.


I've started building a heliocentric game library for calculating positions of planets, moons and starts based on any time. It's in it's infancy, but I've got it working to JDE2000 (1 Jan 2000) +- 1500 years with pretty good accuracy. I'm working on moon positions, tilts and spacing now, and will focus on stars next.

It's made to be dropped into the Torque 3D engine. It's written in TorqueScript (a scripting language similar to a dumbed-down JavaScript/C++ hybrid), so it should be pretty easy to recreate.

I've posted the current version open-source at: http://wecreategames.com/blog/?p=233

It should be pretty easy to take the algorithms and recreate them either in JavaScript or a server-side language and wrap them with a web-services API. Let me know if it helps!


Astronomers are trying to develop a strong API for data sharing. You should start by exploring resources from The National Virtual Observatory.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »