On Fri, 2005-07-22 at 17:56, Erik Hofman wrote:
> Andy Ross wrote:
> > Erik Hofman wrote:
> > 
> >>Since you are already familiar with this stuff, I need the function to
> >>calculate the sun position (in degrees or radians) above the horizon
> >>at a certain time/lat/lon. What is this normally called:
> >>RightAscension, Declination, Magnitude or something else?
> > 
> > None of the above. :) 
> 
> Not even "something else"?
> :-)
> 

Erik:
The position of any astronomical object relative to a viewer standing on
the planet's surface is usually given as "altitude" and "azimuth" - with
the true horizon and true "North" used as the references. Normally, an
object is said to "set" when it crosses the visible horizon. Simple
rise/set programs assume that the visible horizon and true horizon are
the same.

It gets a bit more tricky in a flight sim because the visible horizon
will be significantly below the "true" mathematical one, and thus the
sun might well be visible even though it is below the true horizon. For
orbit simulators, it gets even more extreme.

Additional entertainment will be provided by the fact that and code for
FG needs to work with a WGS84 spheroid, meaning that the distance to the
earth's centre will vary with lat and long, but for *sun* rise and set,
that's probably not significant.

There's a great program called "ephem" which will yield all the routines
you could ever want, though the pointers to "sunriset.c" that someone
else posted here will likely do it too. Not sure of the licence for
'ephem' though.

Somewhere I've got source for my own home-written version of a sun
rise/set program that I wrote a very long time ago (1979 I believe).
I'll see if I can find what I did with it. It started life in Fortran,
but was converted to C ages ago, and will probably do the job just fine.
I'd be quite happy to GPL any such source if it isn't already.

Steve.



_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to