public void CreateEarth() { float x = Mathf.Cos((float)AASEarth.EclipticLatitude(JDNConv.getJulianDayNumberToday(), true)) * Mathf.Cos((float)AASEarth.EclipticLongitude(JDNConv.getJulianDayNumberToday(), true)); float y = Mathf.Sin((float)AASEarth.EclipticLatitude(JDNConv.getJulianDayNumberToday(), true)) * Mathf.Cos((float)AASEarth.EclipticLongitude(JDNConv.getJulianDayNumberToday(), true)); float z = Mathf.Sin((float)AASEarth.EclipticLongitude(JDNConv.getJulianDayNumberToday(), true)); Vector3 forward = new Vector3(x, y, z) * getDistEarth(); Earth = Instantiate(sphere, forward, Sun.transform.rotation); Earth.transform.localScale = Vector3.one * .012742f; Earth.name = "Earth"; }
protected void CalculateGeometricPositions() { eclipticLongitude = GetEclipticLongitude(jd); eclipticLatitude = GetEclipticLatitude(jd); double planetSunDistance = GetRadiusVector(jd); eclipticLongitudeEarth = AASEarth.EclipticLongitude(jd); eclipticLatitudeEarth = AASEarth.EclipticLatitude(jd); double earthSunDistance = AASEarth.RadiusVector(jd); vectorToEarth = VectorToEarth(eclipticLongitude, eclipticLatitude, planetSunDistance, eclipticLongitudeEarth, eclipticLatitudeEarth, earthSunDistance); }
public void EclipticLongitudeTest(double JD, bool bHighPrecision, double expectedLongitude) { double longitude = AASEarth.EclipticLongitude(JD, bHighPrecision); Assert.Equal(expectedLongitude, longitude); }