NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Astronomy: Calculating Positions
From: Paul Hirose
Date: 2008 Apr 06, 16:22 -0700
From: Paul Hirose
Date: 2008 Apr 06, 16:22 -0700
The "Astronomical Almanac" has formulas for computing topocentric position, including the effect of dinural parallax and dinural aberration. The latter is caused by Earth's rotation giving the observer a velocity with respect to the geocenter, and is only about .3" at most. I have a free Windows positional astronomy DLL online which does these things. There's also a C++ example which uses the DLL to compute geocentric and topocentric positions of a star and the Moon. http://home.earthlink.net/~s543t-24dst/sofajpl/lunardist.html There's very little math in the main program. Basically, it just sets up function calls to the DLL, where the real work is done. Almost all the function calls in the sample program are documented here: http://home.earthlink.net/~s543t-24dst/sofajpl/sofajpl_sup1.h.html Because the algorithms are in the DLL, you have to study its source code to understand how it works. All the source code is at the site, but it may be easier to use formulas from a book, especially if you prefer to use spherical trig. The DLL and sample program use spherical coordinates only for input and output. Internally, the computatation uses vectors. The basic process is to get the geocentric rectangular coordinates of the body with respect to the true equator of date, i.e., RA and declination converted to xyz. Get the observer coords in the same system. Then do (body - observer) to get the relative position of the body with respect to the observer. For the observer coordinates, the key routine is called psh_cobsvec(). Inputs are latitude, longitude, height, and the properties of the ellipsoid: equatorial radius and flattening. Outputs are the observer's xyz coordinates. These are constant for a given observing position. But to put those coords into the same system as the body, you must rotate about the z axis by UT1 expressed as an angle. This is performed by psh_cobspv(), which outputs the position and velocity of the observer in vector form. These vectors are one of the inputs to psh_jplanet(), which outputs the apparent position of the desired body. The interfaces of these functions are explained on a web page at the site (the second link above), but to see the implementations you have to go to the Downloads section on the main page and get the second zip file. As I said, it may be easier to just look in the Astronomical Almanac! (Sections B and K) By the way, I'm rewriting the DLL for the Microsoft .NET Framework. The present form is inconvenient because the documentation and function call convention favors C or C++ programmers. In addition, the DLL isn't object-oriented. E.g., there's no "vector" object so you can add two vectors with the + operator. With the new DLL, any .NET Framework language (such as Visual Basic, C++, or C#) will have full access to a variety of positional astronomy classes such as vectors, rotation matrices, Julian dates, and the like. The user won't even be able to tell what languages were used to write the DLL. So far I've ported and tested the IAU SOFA library and JPL planetary ephemerides, and created all the supporting classes. There's a lot more to do, though. -- I block messages that contain attachments or HTML. --~--~---------~--~----~------------~-------~--~----~ Navigation List archive: www.fer3.com/arc To post, email NavList@fer3.com To , email NavList-@fer3.com -~----------~----~----~----~------~----~------~--~---