コード例 #1
0
        public override double getDoubleValue(double arg)
        {
            coord = GPAstroEngine.sun_coordinate(arg);

            switch (valueType)
            {
            case ValueType.Longitude:
                return(coord.eclipticalLongitude);

            case ValueType.Latitude:
                return(coord.eclipticalLatitude);

            case ValueType.Azimuth:
                if (obs != null)
                {
                    GPAstroEngine.calcHorizontal(coord, obs);
                    return(coord.azimuth);
                }
                break;

            case ValueType.Elevation:
                if (obs != null)
                {
                    GPAstroEngine.calcHorizontal(coord, obs);
                    return(coord.elevation);
                }
                break;

            case ValueType.DeclinationTopo:
                return(coord.declination);

            case ValueType.RightAscessionTopo:
                return(coord.right_ascession);

            case ValueType.Declination:
                return(coord.declination);

            case ValueType.RightAscession:
                return(coord.right_ascession);

            case ValueType.Distance:
                return(coord.distanceFromEarth);

            case ValueType.ApparentSiderealTime:
                return(coord.apparent_sidereal_time);

            case ValueType.MeanSiderealTime:
                return(coord.mean_sidereal_time);

            case ValueType.DynamicTime:
                return(coord.getDynamicTime());

            case ValueType.Nutation:
                return(coord.getNutation());

            case ValueType.Obliquity:
                return(coord.getObliquity());

            case ValueType.Sankranti:
                return(getSankrantiDouble(arg));

            case ValueType.SankrantiDistance:
            {
                double sankranti = getSankrantiDouble(arg);
                sankranti = 0.51 - Math.Abs(sankranti - Math.Floor(sankranti) - 0.5);
                return(sankranti);
            }

            default:
                break;
            }

            return(0);
        }
コード例 #2
0
ファイル: GPFunctorMoon.cs プロジェクト: vijeetgv/GCAL
        public override double getDoubleValue(double arg)
        {
            coord = GPAstroEngine.moon_coordinate(arg);

            switch (valueType)
            {
            case ValueType.Longitude:
                return(coord.eclipticalLongitude);

            case ValueType.Latitude:
                return(coord.eclipticalLatitude);

            case ValueType.Azimuth:
                if (obs != null)
                {
                    coord.makeTopocentric(obs);
                    GPAstroEngine.calcHorizontal(coord, obs);
                    return(coord.azimuth);
                }
                break;

            case ValueType.Elevation:
                if (obs != null)
                {
                    coord.makeTopocentric(obs);
                    GPAstroEngine.calcHorizontal(coord, obs);
                    return(coord.elevation);
                }
                break;

            case ValueType.DeclinationTopo:
                if (obs != null)
                {
                    coord.makeTopocentric(obs);
                    return(coord.declination);
                }
                break;

            case ValueType.RightAscessionTopo:
                if (obs != null)
                {
                    coord.makeTopocentric(obs);
                    return(coord.right_ascession);
                }
                break;

            case ValueType.Declination:
                return(coord.declination);

            case ValueType.RightAscession:
                return(coord.right_ascession);

            case ValueType.Distance:
                return(coord.distanceFromEarth);

            case ValueType.ApparentSiderealTime:
                return(coord.apparent_sidereal_time);

            case ValueType.MeanSiderealTime:
                return(coord.mean_sidereal_time);

            case ValueType.DynamicTime:
                return(coord.getDynamicTime());

            case ValueType.Nutation:
                return(coord.getNutation());

            case ValueType.Obliquity:
                return(coord.getObliquity());

            case ValueType.NaksatraDistance:
            {
                double naksatraReal = getNaksatraDouble(arg);
                naksatraReal = 0.51 - Math.Abs(naksatraReal - Math.Floor(naksatraReal) - 0.5);
                return(naksatraReal);
            }

            case ValueType.Naksatra:
                return(getNaksatraDouble(arg));

            default:
                break;
            }

            return(0);
        }
コード例 #3
0
ファイル: GPFunctorSunMoon.cs プロジェクト: vijeetgv/GCAL
        /// <summary>
        ///
        /// </summary>
        /// <param name="arg">Julian Ephemeris (Dynamical) Time</param>
        /// <returns></returns>
        public override double getDoubleValue(double arg)
        {
            coordMoon = GPAstroEngine.moon_coordinate(arg);
            coordSun  = GPAstroEngine.sun_coordinate(arg);

            switch (valueType)
            {
            case ValueType.Longitude:
                return(GPMath.putIn180(coordMoon.eclipticalLongitude - coordSun.eclipticalLongitude));

            case ValueType.Latitude:
                return(GPMath.putIn180(coordMoon.eclipticalLatitude - coordSun.eclipticalLatitude));

            case ValueType.Azimuth:
                if (obs != null)
                {
                    coordMoon.makeTopocentric(obs);
                    GPAstroEngine.calcHorizontal(coordMoon, obs);

                    GPAstroEngine.calcHorizontal(coordSun, obs);
                    return(GPMath.putIn180(coordMoon.azimuth - coordSun.azimuth));
                }
                break;

            case ValueType.Elevation:
                if (obs != null)
                {
                    coordMoon.makeTopocentric(obs);
                    GPAstroEngine.calcHorizontal(coordMoon, obs);
                    GPAstroEngine.calcHorizontal(coordSun, obs);
                    return(GPMath.putIn180(coordMoon.elevation - coordSun.elevation));
                }
                break;

            case ValueType.DeclinationTopo:
                if (obs != null)
                {
                    coordMoon.makeTopocentric(obs);
                    return(GPMath.putIn180(coordMoon.declination - coordSun.declination));
                }
                break;

            case ValueType.RightAscessionTopo:
                if (obs != null)
                {
                    coordMoon.makeTopocentric(obs);
                    return(GPMath.putIn180(coordMoon.right_ascession - coordSun.right_ascession));
                }
                break;

            case ValueType.Declination:
                return(GPMath.putIn180(coordMoon.declination - coordSun.declination));

            case ValueType.TithiDistance:
            {
                double tithi = getTithiDouble();
                tithi = 0.51 - Math.Abs(tithi - Math.Floor(tithi) - 0.5);
                return(tithi);
            }

            case ValueType.YogaDistance:
            {
                double yoga = getYogaDouble(arg);
                yoga = 0.51 - Math.Abs(yoga - Math.Floor(yoga) - 0.5);
                return(yoga);
            }

            case ValueType.RightAscession:
                return(GPMath.putIn180(coordMoon.right_ascession - coordSun.right_ascession));

            case ValueType.RightAscessionAbs:
                return(Math.Abs(GPMath.putIn180(coordMoon.right_ascession - coordSun.right_ascession)));

            case ValueType.ApparentSiderealTime:
                return(coordMoon.apparent_sidereal_time);

            case ValueType.MeanSiderealTime:
                return(coordMoon.mean_sidereal_time);

            case ValueType.DynamicTime:
                return(coordMoon.getDynamicTime());

            case ValueType.Nutation:
                return(coordMoon.getNutation());

            case ValueType.Obliquity:
                return(coordMoon.getObliquity());

            case ValueType.AzimuthElevationDistance:
                if (obs != null)
                {
                    coordMoon.makeTopocentric(obs);
                    GPAstroEngine.calcHorizontal(coordMoon, obs);
                    GPAstroEngine.calcHorizontal(coordSun, obs);
                    return(GPMath.arcDistanceDeg(coordMoon.azimuth, coordMoon.elevation, coordSun.azimuth, coordSun.elevation));
                }
                break;

            case ValueType.RigthAscessionDeclinationDistance:
                return(GPMath.arcDistanceDeg(coordMoon.right_ascession, coordMoon.declination, coordSun.right_ascession, coordSun.declination));

            case ValueType.RigthAscessionDeclinationOpositeDistance:
                return(GPMath.arcDistanceDeg(180 + coordMoon.right_ascession, -coordMoon.declination, coordSun.right_ascession, coordSun.declination));

            case ValueType.Tithi:
                return(getTithiDouble());

            case ValueType.Yoga:
                return(getYogaDouble(arg));

            default:
                break;
            }

            return(0);
        }