tags:

views:

152

answers:

3

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.

+2  A: 

yes - the SunTime class at CodeProject may be of some help!

Grace
Looks like a good fine!
o.k.w
This DOES look really cool. However, I found an open source C project that produces the results I need. Now, to figure out a way to port it to a .NET class library. The C code is ugly, to say the least. I may just have to tweak it to accept an arg array and return a fixed array of results. Not exactly a C guy, so this'll be interesting.
NovaJoe
A: 

Also, there is a ephemeris which might be what you're looking for as this is the ultimate astronomer programming kit? Have made a feeble attempt at it a few years ago when I made an astrology program using VB6, it produced a nice report of the starsigns in the each of the twelve houses, but couldn't get the drawing of the stars at the time of the birthdate/time input accurate enough.

Hope this helps, Best regards, Tom.

tommieb75
This looks really cool too. So many options in the responses to this post! So exciting! Thanks folks!
NovaJoe
Hey Tom, I looked at this. Although I'm sure the astrology portion of the library is very good, the astronomy portion for producing the ephemrides isn't quite what I'm looking for. Thanks though!
NovaJoe
A: 

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.

Tim Long
I DID see these on the USNO site, and thank you.I will definitely check out the ASCOM project. Sounds promising. I've seen mention of ASCOM in the Starry Night software and on amateur telescopes. Thanks!
NovaJoe