示例#1
0
        /**
         * Get the look angle for the observers position to the object
         * @param[in] eci the object to find the look angle to
         * @returns the lookup angle
         */
        public CoordTopocentric GetLookAngle(Eci eci)
        {
            /*
             * update the observers Eci to match the time of the Eci passed in
             * if necessary
             */
            Update(eci.GetDateTime());

            /*
             * calculate differences
             */
            Vector range_rate = eci.Velocity() - m_eci.Velocity();
            Vector range      = eci.Position() - m_eci.Position();

            range.w = range.Magnitude();

            /*
             * Calculate Local Mean Sidereal Time for observers longitude
             */
            double theta = eci.GetDateTime().ToLocalMeanSiderealTime(m_geo.longitude);

            double sin_lat   = Math.Sin(m_geo.latitude);
            double cos_lat   = Math.Cos(m_geo.latitude);
            double sin_theta = Math.Sin(theta);
            double cos_theta = Math.Cos(theta);

            double top_s = sin_lat * cos_theta * range.x
                           + sin_lat * sin_theta * range.y - cos_lat * range.z;
            double top_e = -sin_theta * range.x
                           + cos_theta * range.y;
            double top_z = cos_lat * cos_theta * range.x
                           + cos_lat * sin_theta * range.y + sin_lat * range.z;
            double az = Math.Atan(-top_e / top_s);

            if (top_s > 0.0)
            {
                az += Global.kPI;
            }

            if (az < 0.0)
            {
                az += 2.0 * Global.kPI;
            }

            double el   = Math.Asin(top_z / range.w);
            double rate = range.Dot(range_rate) / range.w;

            /*
             * azimuth in radians
             * elevation in radians
             * range in km
             * range rate in km/s
             */
            return(new CoordTopocentric(az, el, range.w, rate));
        }
示例#2
0
 /**
  * Set the observers location
  * @param[in] geo the observers position
  */
 public void SetLocation(CoordGeodetic geo)
 {
     m_geo = geo;
     m_eci.Update(m_eci.GetDateTime(), m_geo);
 }