Re: [find_orb] Finding vectors for Gauss method: replying two weeks later...

Bill J Gray Aug 22, 2012

Hi Barbara,

A very late reply here to your post of 6 August; I hope it's not _too_ late
to be of any use!

> I'm writing my own c++ program for determining the orbit of a body with Gauss method
> and I have some problems in calculating the three vectors (at three times) earth-body
> (actually i need unit vector). I found out that Find_orb uses Gauss method too and I
> was wondering if you have done a specific function that I can integrate in my program.

If you're looking for the actual Gauss-method code, that would be in 'gauss.cpp'...
but it sounds as if what you really want is just the code that computes where the earth
is at a given time? For this, I'd suggest going straight to the C code that gets the
positional data from the JPL ephemerides. That code is provided with the Find_Orb
source you already have; it's described at

http://www.projectpluto.com/jpl_eph.htm

You wouldn't necessarily see that JPL ephemerides are used in Find_Orb, because
for performance reasons, Find_Orb stores planetary positions in a cache. (Early on,
I realized that a _lot_ of time in Find_Orb was spent in computing planetary positions.
And frequently, such positions were re-computed many times; you can get a big
speed-up by computing a position once, usually using the JPL ephemerides, and then
storing it for use when you're asked for it again. All this caching adds a bit of
complexity you probably don't need. At the very least, I suggest that you get your
code working _without_ caching positions; then you can add caching later, if you find
that your program is slower than you'd like.)

> I also tried to download the c++ package but it seems to me that there is not such a
> function (maybe I didn't recognize it) and when I try to compile the Gauss.cpp program
> I have a great number of errors that could come from the lack of libraries. For example
> I think that the libraries
>
> "watdefs.h"
> "afuncs.h"
>
> are actually missing.

Those are part of the 'basic astronomical functions' library, provided at

http://www.projectpluto.com/source.htm#astrocalc

You do need to get this library for Find_Orb to compile. It contains functions for
things such as time and coordinate conversions, converting Keplerian orbital elements
to Cartesian and vice versa, and so on.

-- Bill