/// <summary> /// Constructs a new <see cref="SunriseSunsetCalculator"/> with the given <see cref="Location"/> /// </summary> /// <param name="location"><see cref="Location"/> object containing the latitude/longitude of the location to computer for sunrise/sunset for</param> public SunriseSunsetCalculator(Location location) { this.location = location; this.calculator = new SolarEventCalculator(location); }
public static DateTime?GetSunset(double latitude, double longitude, DateTime date, double degrees) { SolarEventCalculator solarEventCalculator = new SolarEventCalculator(new Location(latitude, longitude)); return(solarEventCalculator.ComputeSunsetCalendar(new Zenith(90 - degrees), date)); }