Ejemplo n.º 1
0
        public IActionResult Index()
        {
            DateTime birthday  = new DateTime(1991, 6, 5, 8, 26, 00);
            Equator  equator   = Sun.EquatorialCoordinate(birthday);
            Ecliptic mooquator = Moon.EclipticalCoordinate(birthday);
            Ecliptic merquator = Mercury.EclipticalCoordinate(birthday);
            Ecliptic vequator  = Venus.EclipticalCoordinate(birthday);
            Ecliptic mequator  = Mars.EclipticalCoordinate(birthday);
            Ecliptic jequator  = Jupiter.EclipticalCoordinate(birthday);
            Ecliptic sequator  = Saturn.EclipticalCoordinate(birthday);
            Ecliptic urquator  = Uranus.EclipticalCoordinate(birthday);
            Ecliptic nequator  = Neptune.EclipticalCoordinate(DateTime.Now);
            Ecliptic ecliptic  = CoordinateSystem.Equatorial2Ecliptic(equator);

            Debug.WriteLine(DateTime.Now);
            Debug.WriteLine("SUN" + ecliptic.Longitude);
            Debug.WriteLine("Moon" + mooquator.Longitude);
            Debug.WriteLine("MERC: " + merquator.Longitude);
            Debug.WriteLine("VENUS" + vequator.Longitude);
            Debug.WriteLine("Mars" + mequator.Longitude);
            Debug.WriteLine("Jup: " + jequator.Longitude);
            Debug.WriteLine("Saturn: " + sequator.Longitude);
            Debug.WriteLine("Urnuas: " + urquator.Longitude);
            Debug.WriteLine("Neptune: " + nequator.Longitude);

            return(View());
        }
Ejemplo n.º 2
0
    void Update()
    {
        Sun.Rotate(Vector3.up * Time.deltaTime * 5);

        Mercury.RotateAround(Sun.position, new Vector3(0.1f, 1, 0), 60 * Time.deltaTime);
        Mercury.Rotate(Vector3.up * 10000 / 58 * Time.deltaTime);

        Venus.RotateAround(Sun.position, new Vector3(0, 1, -0.1f), 55 * Time.deltaTime);
        Venus.Rotate(Vector3.up * 10000 / 243 * Time.deltaTime);

        Earth.RotateAround(Sun.position, Vector3.up, 50 * Time.deltaTime);
        Earth.Rotate(Vector3.up * 10000 * Time.deltaTime);
        Moon.RotateAround(Earth.position, Vector3.up, 5 * Time.deltaTime);
        Moon.Rotate(Vector3.up * 10000 / 27 * Time.deltaTime);

        Mars.RotateAround(Sun.position, new Vector3(0.2f, 1, 0), 45 * Time.deltaTime);
        Mars.Rotate(Vector3.up * 10000 * Time.deltaTime);

        Jupiter.RotateAround(Sun.position, new Vector3(-0.1f, 2, 0), 38 * Time.deltaTime);
        Jupiter.Rotate(Vector3.up * 10000 / 0.3f * Time.deltaTime);

        Saturn.RotateAround(Sun.position, new Vector3(0, 1, 0.2f), 36 * Time.deltaTime);
        Saturn.Rotate(Vector3.up * 10000 / 0.4f * Time.deltaTime);

        Uranus.RotateAround(Sun.position, new Vector3(0, 2, 0.1f), 35 * Time.deltaTime);
        Uranus.Rotate(Vector3.up * 10000 / 0.6f * Time.deltaTime);

        Neptune.RotateAround(Sun.position, new Vector3(-0.1f, 1, -0.1f), 33 * Time.deltaTime);
        Neptune.Rotate(Vector3.up * 10000 / 0.7f * Time.deltaTime);
    }
Ejemplo n.º 3
0
 private void image7_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     if (i == 1)
     {
         Neptune.Begin();
         i = 2;
         PresentTheAttributes(7);
     }
 }
Ejemplo n.º 4
0
    void Start()
    {
        Mercury.AddComponent <Planet>().speed = 47.89f;
        Venus.AddComponent <Planet>().speed   = 35.03f;
        Earth.AddComponent <Planet>().speed   = 30f;
        Mars.AddComponent <Planet>().speed    = 24.13f;
        Jupiter.AddComponent <Planet>().speed = 13.06f;
        Saturn.AddComponent <Planet>().speed  = 9.64f;
        Uranus.AddComponent <Planet>().speed  = 6.81f;
        Neptune.AddComponent <Planet>().speed = 5.43f;
        Moon.AddComponent <Moon>().speed      = 300f;

        gs = new GUIStyle
        {
            fontSize = 35
        };
        gs.normal.textColor = new Color(1, 0, 0);
        gs.fontStyle        = FontStyle.Italic;
    }
Ejemplo n.º 5
0
        public void SetNeptuneData()
        {
            Ecliptic nepquator = Neptune.EclipticalCoordinate(BirthDate);

            UserNeptune = nepquator.Longitude;
        }
Ejemplo n.º 6
0
        public IActionResult Index(double latitude = 39.56, double longitude = 116.23, DateTime time = default, string zone = default)
        {
            if (time == default)
            {
                time = DateTime.Now;
            }

            TimeZoneInfo timeZone;

            if (string.IsNullOrEmpty(zone))
            {
                timeZone = TimeZoneInfo.Local;
            }
            else
            {
                timeZone = TimeZoneInfo.FindSystemTimeZoneById(zone);
            }

            Sun     sun     = new Sun(latitude, longitude, time, timeZone);
            Mercury mercury = new Mercury(latitude, longitude, time, timeZone);
            Venus   venus   = new Venus(latitude, longitude, time, timeZone);
            Mars    mars    = new Mars(latitude, longitude, time, timeZone);
            Jupiter jupiter = new Jupiter(latitude, longitude, time, timeZone);
            Saturn  saturn  = new Saturn(latitude, longitude, time, timeZone);
            Uranus  uranus  = new Uranus(latitude, longitude, time, timeZone);
            Neptune neptune = new Neptune(latitude, longitude, time, timeZone);

            double[] ra = new[] { sun.Equator.RA, mercury.Equator.RA, venus.Equator.RA, mars.Equator.RA,
                                  jupiter.Equator.RA, saturn.Equator.RA, uranus.Equator.RA, neptune.Equator.RA };
            double[] dec = new[] { sun.Equator.Dec, mercury.Equator.Dec, venus.Equator.Dec, mars.Equator.Dec,
                                   jupiter.Equator.Dec, saturn.Equator.Dec, uranus.Equator.Dec, neptune.Equator.Dec };
            TimeSpan[] rising = new[] { sun.Rising, mercury.Rising, venus.Rising, mars.Rising,
                                        jupiter.Rising, saturn.Rising, uranus.Rising, neptune.Rising };
            TimeSpan[] culmination = new[] { sun.Culmination, mercury.Culmination, venus.Culmination, mars.Culmination,
                                             jupiter.Culmination, saturn.Culmination, uranus.Culmination, neptune.Culmination };
            TimeSpan[] setting = new[] { sun.Setting, mercury.Setting, venus.Setting, mars.Setting,
                                         jupiter.Setting, saturn.Setting, uranus.Setting, neptune.Setting };
            double[] toEarth = new[] { sun.ToEarth, mercury.ToEarth, venus.ToEarth, mars.ToEarth,
                                       jupiter.ToEarth, saturn.ToEarth, uranus.ToEarth, neptune.ToEarth };
            double[] toSun = new[] { 0, mercury.ToSun, venus.ToSun, mars.ToSun,
                                     jupiter.ToSun, saturn.ToSun, uranus.ToSun, neptune.ToSun };
            double[] ea = new[] { sun.ElevationAngle, mercury.ElevationAngle, venus.ElevationAngle, mars.ElevationAngle,
                                  jupiter.ElevationAngle, saturn.ElevationAngle, uranus.ElevationAngle, neptune.ElevationAngle };
            double[] az = new[] { sun.Azimuth, mercury.Azimuth, venus.Azimuth, mars.Azimuth,
                                  jupiter.Azimuth, saturn.Azimuth, uranus.Azimuth, neptune.Azimuth };

            ViewData["Latitude"]  = latitude;
            ViewData["Longitude"] = longitude;
            ViewData["Time"]      = time;
            ViewData["Zone"]      = timeZone.Id;

            ViewData["RA"]          = ra;
            ViewData["Dec"]         = dec;
            ViewData["Rising"]      = rising;
            ViewData["Culmination"] = culmination;
            ViewData["Setting"]     = setting;
            ViewData["ToEarth"]     = toEarth;
            ViewData["ToSun"]       = toSun;
            ViewData["EA"]          = ea;
            ViewData["Az"]          = az;

            return(View());
        }