示例#1
0
        /// <summary>
        /// Creates a instance of the class from geodetic coordinates.
        /// </summary>
        /// <param name="geo">The geocentric coordinates.</param>
        /// <param name="date">The Julian date.</param>
        /// <remarks>
        /// Assumes the Earth is an oblate spheroid.
        /// Reference: The 1992 Astronomical Almanac, page K11
        /// Reference: www.celestrak.com (Dr. T.S. Kelso)
        /// </remarks>
        public Eci(Geo geo, Julian date)
        {
            double lat = geo.LatitudeRad;
             double lon = geo.LongitudeRad;
             double alt = geo.Altitude;

             // Calculate Local Mean Sidereal Time (theta)
             double theta = date.ToLmst(lon);
             double c = 1.0 / Math.Sqrt(1.0 + Globals.F * (Globals.F - 2.0) *
                          Globals.Sqr(Math.Sin(lat)));
             double s = Globals.Sqr(1.0 - Globals.F) * c;
             double achcp = (Globals.Xkmper * c + alt) * Math.Cos(lat);

             Position = new Vector();

             Position.X = achcp * Math.Cos(theta);             // km
             Position.Y = achcp * Math.Sin(theta);             // km
             Position.Z = (Globals.Xkmper * s + alt) * Math.Sin(lat);   // km
             Position.W = Math.Sqrt(Globals.Sqr(Position.X) +
                                Globals.Sqr(Position.Y) +
                                Globals.Sqr(Position.Z));  // range, km

             Velocity = new Vector();
             double mfactor = Globals.TwoPi * (Globals.OmegaE / Globals.SecPerDay);

             Velocity.X = -mfactor * Position.Y;               // km / sec
             Velocity.Y =  mfactor * Position.X;               // km / sec
             Velocity.Z = 0.0;                                 // km / sec
             Velocity.W = Math.Sqrt(Globals.Sqr(Velocity.X) +  // range rate km/sec^2
                                Globals.Sqr(Velocity.Y));
        }
示例#2
0
 /// <summary>
 /// Create a Site object from Geo object.
 /// </summary>
 /// <param name="geo">The Geo object.</param>
 public Site(Geo geo)
 {
     Geo = new Geo(geo);
 }
示例#3
0
 /// <summary>
 /// Standard constructor.
 /// </summary>
 /// <param name="degLat">Latitude in degrees (negative south).</param>
 /// <param name="degLon">Longitude in degrees (negative west).</param>
 /// <param name="kmAlt">Altitude in kilometers.</param>
 /// <param name="model">The earth ellipsoid model.</param>
 public Site(double degLat, double degLon, double kmAlt)
 {
     Geo = new Geo(Globals.ToRadians(degLat),
                Globals.ToRadians(degLon),
                kmAlt);
 }
示例#4
0
 /// <summary>
 /// Creates a Geo object from a source Geo object.
 /// </summary>
 /// <param name="geo">The source Geo object.</param>
 public Geo(Geo geo)
 {
     LatitudeRad  = geo.LatitudeRad;
      LongitudeRad = geo.LongitudeRad;
      Altitude     = geo.Altitude;
 }
示例#5
0
 /// <summary>
 /// Constructor accepting Geo and Julian objects.
 /// </summary>
 /// <param name="geo">The Geo object.</param>
 /// <param name="date">The Julian date.</param>
 public GeoTime(Geo geo, Julian date)
     : base(geo)
 {
     Date = date;
 }
示例#6
0
 /// <summary>
 /// Creates a new instance of the class from geodetic coordinates.
 /// </summary>
 /// <param name="geo">The geodetic coordinates.</param>
 /// <param name="date">The time associated with the ECI coordinates.</param>
 public EciTime(Geo geo, Julian date)
     : base(geo, date)
 {
     Date = date;
 }