public double HourAngle(double angle, bool afterTransit) { return(Astronomical.CorrectedHourAngle(this.approximateTransit, angle, this.observer, afterTransit, this.solar.ApparentSiderealTime, this.solar.RightAscension, this.prevSolar.RightAscension, this.nextSolar.RightAscension, this.solar.Declination, this.prevSolar.Declination, this.nextSolar.Declination)); }
public SolarTime(DateTime today, Coordinates coordinates) { DateTime calendar = today.ToUniversalTime(); DateTime tomorrow = calendar.AddDays(1); DateTime yesterday = calendar.AddDays(-1); this.prevSolar = new SolarCoordinates(CalendricalHelper.JulianDay(yesterday)); this.solar = new SolarCoordinates(CalendricalHelper.JulianDay(today)); this.nextSolar = new SolarCoordinates(CalendricalHelper.JulianDay(tomorrow)); this.approximateTransit = Astronomical.ApproximateTransit(coordinates.Longitude, solar.ApparentSiderealTime, solar.RightAscension); double solarAltitude = -50.0 / 60.0; this.observer = coordinates; this.Transit = Astronomical.CorrectedTransit(this.approximateTransit, coordinates.Longitude, solar.ApparentSiderealTime, solar.RightAscension, prevSolar.RightAscension, nextSolar.RightAscension); this.Sunrise = Astronomical.CorrectedHourAngle(this.approximateTransit, solarAltitude, coordinates, false, solar.ApparentSiderealTime, solar.RightAscension, prevSolar.RightAscension, nextSolar.RightAscension, solar.Declination, prevSolar.Declination, nextSolar.Declination); this.Sunset = Astronomical.CorrectedHourAngle(this.approximateTransit, solarAltitude, coordinates, true, solar.ApparentSiderealTime, solar.RightAscension, prevSolar.RightAscension, nextSolar.RightAscension, solar.Declination, prevSolar.Declination, nextSolar.Declination); }