コード例 #1
0
        private string GetDSOOveriew(CelestiaDSO DSO)
        {
            var str = "";

            var celPos = DSO.Position;
            var eqPos  = CelestiaHelper.EclipticToEquatorial(CelestiaHelper.CelToJ2000Ecliptic(celPos));
            var sph    = CelestiaHelper.RectToSpherical(eqPos);

            var hms = new CelestiaDMS(sph.X);

            str += string.Format(LocalizationHelper.Localize("RA: {0}h {1}m {2:N2}s"), hms.Hours, hms.Minutes, hms.Seconds);

            str += "\n";
            var dms = new CelestiaDMS(sph.Y);

            str += string.Format(LocalizationHelper.Localize("DEC: {0}° {1}′ {2:N2}″"), dms.Hours, dms.Minutes, dms.Seconds);

            var galPos = CelestiaHelper.EquatorialToGalactic(eqPos);

            sph = CelestiaHelper.RectToSpherical(galPos);

            str += "\n";
            dms  = new CelestiaDMS(sph.X);
            str += string.Format(LocalizationHelper.Localize("L: {0}° {1}′ {2:N2}″"), dms.Hours, dms.Minutes, dms.Seconds);

            str += "\n";
            dms  = new CelestiaDMS(sph.Y);
            str += string.Format(LocalizationHelper.Localize("B: {0}° {1}′ {2:N2}″"), dms.Hours, dms.Minutes, dms.Seconds);

            return(str);
        }
コード例 #2
0
        private string GetStarOverview(CelestiaStar Star, CelestiaAppCore AppCore)
        {
            var str = "";

            var time   = AppCore.Simulation.Time;
            var celPos = Star.PositionAtTime(time).OffsetFrom(CelestiaUniversalCoord.Zero);
            var eqPos  = CelestiaHelper.EclipticToEquatorial(CelestiaHelper.CelToJ2000Ecliptic(celPos));
            var sph    = CelestiaHelper.RectToSpherical(eqPos);

            var hms = new CelestiaDMS(sph.X);

            str += string.Format(LocalizationHelper.Localize("RA: {0}h {1}m {2:N2}s"), hms.Hours, hms.Minutes, hms.Seconds);

            str += "\n";
            var dms = new CelestiaDMS(sph.Y);

            str += string.Format(LocalizationHelper.Localize("DEC: {0}° {1}′ {2:N2}″"), dms.Hours, dms.Minutes, dms.Seconds);

            return(str);
        }