def calc_horizontal(self, date, longitude, latitude):
        h = GCMath.putIn360(
            GCEarthData.star_time(date) - self.rektaszension + longitude)

        self.azimuth = GCMath.rad2deg(
            math.atan2(
                GCMath.sinDeg(h),
                GCMath.cosDeg(h) * GCMath.sinDeg(latitude) -
                GCMath.tanDeg(self.declination) * GCMath.cosDeg(latitude)))

        self.elevation = GCMath.rad2deg(
            math.asin(
                GCMath.sinDeg(latitude) * GCMath.sinDeg(self.declination) +
                GCMath.cosDeg(latitude) * GCMath.cosDeg(self.declination) *
                GCMath.cosDeg(h)))
    def correct_position(self, jdate, latitude, longitude, height):
        b_a = 0.99664719

        u = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(latitude))
        rho_sin = b_a * GCMath.sinDeg(u) + height / 6378140.0 * GCMath.sinDeg(
            latitude)
        rho_cos = GCMath.cosDeg(
            u) + height / 6378140.0 * GCMath.cosDeg(latitude)

        self.parallax = GCMath.arcSinDeg(
            GCMath.sinDeg(8.794 / 3600) / (MoonDistance(jdate) / GCMath.AU))

        h = GCEarthData.star_time(jdate) - longitude - self.rektaszension
        delta_alpha = GCMath.arcTanDeg(
            (-rho_cos * GCMath.sinDeg(self.parallax) * GCMath.sinDeg(h)) /
            (GCMath.cosDeg(self.declination) -
             rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h)))
        self.rektaszension = self.rektaszension + delta_alpha
        self.declination = GCMath.arcTanDeg(
            ((GCMath.sinDeg(self.declination) - rho_sin *
              GCMath.sinDeg(self.parallax)) * GCMath.cosDeg(delta_alpha)) /
            (GCMath.cosDeg(self.declination) -
             rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h)))
    def getTopocentricEquatorial(self, obs, jdate):
        b_a = 0.99664719
        tec = GCCoords.GCEquatorialCoords()

        altitude = 0

        #   geocentric position of observer on the earth surface
        #   10.1 - 10.3
        u = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(obs.latitude_deg))
        rho_sin = b_a * GCMath.sinDeg(
            u) + altitude / 6378140.0 * GCMath.sinDeg(obs.latitude_deg)
        rho_cos = GCMath.cosDeg(u) + altitude / 6378140.0 * GCMath.cosDeg(
            obs.latitude_deg)

        #   equatorial horizontal paralax
        #   39.1
        parallax = GCMath.arcSinDeg(
            GCMath.sinDeg(8.794 / 3600) / (self.radius / GCMath.AU))

        #   geocentric hour angle of the body
        h = GCEarthData.star_time(
            jdate) + obs.longitude_deg - self.rektaszension

        #   39.2
        delta_alpha = GCMath.arcTanDeg(
            (-rho_cos * GCMath.sinDeg(self.parallax) * GCMath.sinDeg(h)) /
            (GCMath.cosDeg(self.declination) -
             rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h)))
        tec.rightAscension = self.rektaszension + delta_alpha
        tec.declination = GCMath.arcTanDeg(
            ((GCMath.sinDeg(self.declination) - rho_sin *
              GCMath.sinDeg(self.parallax)) * GCMath.cosDeg(delta_alpha)) /
            (GCMath.cosDeg(self.declination) -
             rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h)))

        return tec