Anyone know of a web service or .NET class library that can provide rise/set times for the sun and moon for any given date and any given latitude/longitude?
Thanks in advance.
yes - the SunTime class at CodeProject may be of some help!
Have a look at The ASCOM Initiative. This is the technology used by Microsoft's World Wide Telescope to provide control of telescopes. In version 5.5 of the ASCOM Platform, one of the new components that we've just introduced is a .NET interface to the NOVAS library, which gives you a host of vector astrometry routines and the Kepler orbit engine for doing positional astrometry on solar system bodies.
I don't think that there is a function that will directly give you sunrise/sunset, but it will give you all of the building blocks you need to compute these and much more.
All of this is open source, too. The original NOVAS routines are available from the US Naval Observatory site linked above, in both FORTRAN and C. The ASCOM source code is available from our subversion server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With