Skip to content

ra1han/solar-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet Build status

Solar Calculator

Calculate the sunset and sunrise time based on the date and the latitude/longitude.

The implementation is based on the algorithm found in these two links -

  1. Sunrise Equation
  2. Sun position

The project is available in nuget - https://www.nuget.org/packages/solar-calculator/

Usage

// Dhaka
var location = new
{
	latitude = 23.777176,
	longitude = 90.399452,
};
var theDate = new DateTime(2018, 1, 1);  // Jan 1 2018          
var results = theDate.Times(location.latitude, location.longitude, TimeSpan.FromHours(18)); // UTC offset for locale on Jan 1, not using daylight savings

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages