public SilverLiningLocation(SilverLiningLocation l) { latitude = l.GetLatitude(); longitude = l.GetLongitude(); altitude = l.GetAltitude(); }
public SilverLiningLocation (SilverLiningLocation l) { latitude = l.GetLatitude (); longitude = l.GetLongitude (); altitude = l.GetAltitude (); }
public void Update(SilverLiningTime time, SilverLiningLocation location) { bool timeChanged = false; bool locationChanged = false; if (time != lastTime) { timeChanged = true; lastTime = new SilverLiningTime(time); } if (location != lastLocation) { locationChanged = true; lastLocation = new SilverLiningLocation(location); } if (timeChanged || locationChanged) { T = time.GetEpoch2000Centuries(true); Tuncorr = time.GetEpoch2000Centuries(false); epochDays = time.GetEpoch1990Days(false); SilverLiningMatrix3 Rx, Ry, Rz; Rx = new SilverLiningMatrix3(); Ry = new SilverLiningMatrix3(); Rz = new SilverLiningMatrix3(); Rx.FromRx(-0.1118 * T); Ry.FromRy(0.00972 * T); Rz.FromRz(-0.01118 * T); precession = Rz * (Ry * Rx); GMST = 4.894961 + 230121.675315 * Tuncorr; // radians LMST = GMST + RADIANS(location.GetLongitude()); // radians double latitude = RADIANS(location.GetLatitude()); e = 0.409093 - 0.000227 * T; Ry.FromRy(-(latitude - PI / 2.0)); Rz.FromRz(LMST); Rx.FromRx(-e); equatorialToHorizon = Ry * Rz * precession; eclipticToHorizon = Ry * Rz * Rx * precession; eclipticToEquatorial = Rx; equatorialToGeographic.FromRz(GMST); geographicToEquatorial = equatorialToGeographic.Transpose(); horizonToEquatorial = equatorialToHorizon.Transpose(); horizonToGeographic = equatorialToGeographic * horizonToEquatorial; geographicToHorizon = equatorialToHorizon * geographicToEquatorial; ComputeSunPosition(); ComputeMoonPosition(); ComputeEarthPosition(); ComputeMoonPositionAngle(); for (int i = 0; i < (int)Planets.NUM_PLANETS; i++) { if (i != (int)Planets.EARTH) { ComputePlanetPosition(i); } } } }
public void Update (SilverLiningTime time, SilverLiningLocation location) { bool timeChanged = false; bool locationChanged = false; if (time != lastTime) { timeChanged = true; lastTime = new SilverLiningTime (time); } if (location != lastLocation) { locationChanged = true; lastLocation = new SilverLiningLocation (location); } if (timeChanged || locationChanged) { T = time.GetEpoch2000Centuries (true); Tuncorr = time.GetEpoch2000Centuries (false); epochDays = time.GetEpoch1990Days (false); SilverLiningMatrix3 Rx, Ry, Rz; Rx = new SilverLiningMatrix3 (); Ry = new SilverLiningMatrix3 (); Rz = new SilverLiningMatrix3 (); Rx.FromRx (-0.1118 * T); Ry.FromRy (0.00972 * T); Rz.FromRz (-0.01118 * T); precession = Rz * (Ry * Rx); GMST = 4.894961 + 230121.675315 * Tuncorr; // radians LMST = GMST + RADIANS (location.GetLongitude ()); // radians double latitude = RADIANS (location.GetLatitude ()); e = 0.409093 - 0.000227 * T; Ry.FromRy (-(latitude - PI / 2.0)); Rz.FromRz (LMST); Rx.FromRx (-e); equatorialToHorizon = Ry * Rz * precession; eclipticToHorizon = Ry * Rz * Rx * precession; eclipticToEquatorial = Rx; equatorialToGeographic.FromRz (GMST); geographicToEquatorial = equatorialToGeographic.Transpose (); horizonToEquatorial = equatorialToHorizon.Transpose (); horizonToGeographic = equatorialToGeographic * horizonToEquatorial; geographicToHorizon = equatorialToHorizon * geographicToEquatorial; ComputeSunPosition (); ComputeMoonPosition (); ComputeEarthPosition (); ComputeMoonPositionAngle (); for (int i = 0; i < (int)Planets.NUM_PLANETS; i++) { if (i != (int)Planets.EARTH) { ComputePlanetPosition (i); } } } }