Esempio n. 1
0
        private double GetHourAngleFromAngle(Angle raAxisAngle)
        {
            double hours = HourAngle.DegreesToHours(AstroConvert.Range360Degrees(360.0 - raAxisAngle.Value));

            if (Hemisphere == HemisphereOption.Northern)
            {
                return(AstroConvert.RangeRA(hours + 6.0));
            }
            else
            {
                return(AstroConvert.RangeRA((24.0 - hours) + 6.0));
            }
        }
Esempio n. 2
0
        private Angle GetAngleFromHourAngle(double hourAngle)
        {
            double ha = 0.0;
            double degrees;

            if (Hemisphere == HemisphereOption.Northern)
            {
                ha      = AstroConvert.RangeRA(hourAngle - 6.0); // Renormalise from a perpendicular position
                degrees = HourAngle.HoursToDegrees(ha);
            }
            else
            {
                System.Diagnostics.Debug.Assert(false, "GetAngleFromHours not tested for Southern Hemisphere");
                ha      = AstroConvert.RangeRA((24 - hourAngle) - 6.0); // Renormalise from a perpendicular position
                degrees = HourAngle.HoursToDegrees(ha);
            }
            return(AstroConvert.Range360Degrees(360.0 - degrees));
        }
Esempio n. 3
0
        private Angle GetAngleFromDecDegrees(double angle, bool flipDEC)
        {
            double offset = -90.0; // This may vary in the future if zero degrees is no longer at 12-0-clock
            double result = 0.0;

            if (Hemisphere == HemisphereOption.Southern)
            {
                angle = 360.0 - angle;
            }
            if (angle > 180.0 && !flipDEC)
            {
                result = offset - angle;
            }
            else
            {
                result = angle + offset;
            }
            // This routine works clockwise so need to convert to Anti-clockwise
            result = AstroConvert.Range360Degrees(360 + result);
            return(result);
        }
Esempio n. 4
0
        private double GetDecDegreesFromAngle(Angle decAxisAngle)
        {
            double i = 0.0;

            if (decAxisAngle.Value >= 180)
            {
                i = decAxisAngle.Value - 270.0;
            }
            else
            {
                i = 90.0 - decAxisAngle.Value;
            }
            if (Hemisphere == HemisphereOption.Northern)
            {
                return(AstroConvert.Range360Degrees(i));
            }
            else
            {
                return(AstroConvert.Range360Degrees(360.0 - i));
            }
        }