PyEphem (sunrise / sunset time calculation) equivalent in C#
PyEphem is a neat library that allows easy calculation of sunrise, set, dawn, and dusk 开发者_开发问答of location based on lat, long, and UTC timestamp
I don't want to go through the calculation myself, rather I was wondering if there is an existing library I could use
http://www.codeproject.com/KB/cs/SunTime.aspx
http://www.codeproject.com/KB/recipes/SolarCalculator.aspx
I know this post is old but check out CoordinateSharp. It can do exactly what you described. It can even do Solar/Lunar eclipse calculations.
Example Usage:
Coordinate c = new Coordinate(19.0991676, -98.2209974, DateTime.Now());
c.CelestialInfo.SunRise; //Returns sunrise nullable DateTime for location.
精彩评论