Skip to content

Siliconrob/solar-calculator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet Build status 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/solarday-calculator/

Usage

// Fort Worth
var location = new
{
	latitude = 32.768799,
	longitude = -97.309341,
};
var theDate = new DateTime(2018, 1, 1);  // Jan 1 2018          
var results = theDate.Times(location.latitude, location.longitude, TimeSpan.FromHours(-6)); // UTC offset for locale on Jan 1, not using daylight savings

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.0%
  • Shell 1.0%