Пример #1
0
        /// <summary>
        /// 通过运动状态初始化。
        /// </summary>
        /// <param name="MotionState">空间直角坐标系中的坐标和速度向量</param>
        public CelestialMomentEllipseOrbit(MotionState MotionState)
        {
            #region 由运动状态计算轨道6根数
            var pos      = MotionState.Position;
            var velocity = MotionState.Velocity;
            //中间变量准备
            XYZ    hXyz = pos.Cross(velocity);
            double hLen = hXyz.Length;
            double r    = pos.Length;
            double vv   = velocity.Dot(velocity);

            //计算轨道倾角
            double i = Math.Acos(hXyz.Z / hLen); //表示在Z轴上的投影,与上结果计算一致

            //计算升交点赤经
            double Ω = Math.Atan2(hXyz.X, -hXyz.Y);

            //计算轨道长半轴a,
            double a     = 1 / (2 / r - vv / GeoConst.GM);                   //由活力公式计算
            double sqrtA = Math.Sqrt(a);
            double n     = Math.Sqrt(GeoConst.GM) / (sqrtA * sqrtA * sqrtA); //平运动角速度n

            //离心率e,偏近点角E ,平近点交M
            double rdotv = pos.Dot(velocity);
            double eCosE = 1 - r / a;
            double eSinE = rdotv / Math.Sqrt(GeoConst.GM * a);
            double e     = Math.Sqrt(eSinE * eSinE + eCosE * eCosE); //离心率e
            double E     = Math.Atan2(eSinE, eCosE);                 //偏近点角E
            double M     = E - eSinE;                                //平近点角

            //计算近升角距ω
            XYZ    eXyz = velocity.Cross(hXyz) / GeoConst.GM - pos.UnitVector();
            double ω    = Math.Atan2(eXyz.Z, (eXyz.Y * Math.Sin(Ω) + eXyz.X * Math.Cos(Ω)) * Math.Sin(i));

            double u  = Math.Atan2(pos.Z, (pos.Y * Math.Sin(Ω) + pos.X * Math.Cos(Ω)) * Math.Sin(i));
            double ff = u - ω;//真近点角
            #endregion

            var momentEllipseOrbit = new MomentEllipseOrbit(M, new PlaneEllipse(a, e));
            Init(ω, i, Ω, momentEllipseOrbit);
        }
Пример #2
0
 /// <summary>
 /// 通过参数初始化
 /// </summary>
 /// <param name="argumentOfPerigee">近地点弧角ω</param>
 /// <param name="inclination">轨道倾角</param>
 /// <param name="rightAscensionOfAscendingNode">升交点赤经</param>
 /// <param name="MomentEllipseOrbit">时刻平面轨道</param>
 private void Init(double argumentOfPerigee, double inclination, double rightAscensionOfAscendingNode, MomentEllipseOrbit MomentEllipseOrbit)
 {
     this.ArgumentOfPerigee             = argumentOfPerigee;
     this.RightAscensionOfAscendingNode = rightAscensionOfAscendingNode;
     this.Inclination        = inclination;
     this.MomentEllipseOrbit = MomentEllipseOrbit;
 }
Пример #3
0
 /// <summary>
 /// 通过参数初始化
 /// </summary>
 /// <param name="argumentOfPerigee">近地点弧角ω</param>
 /// <param name="inclination">轨道倾角</param>
 /// <param name="rightAscensionOfAscendingNode">升交点赤经</param>
 /// <param name="MomentEllipseOrbit">时刻平面轨道</param>
 public CelestialMomentEllipseOrbit(double argumentOfPerigee, double inclination, double rightAscensionOfAscendingNode, MomentEllipseOrbit MomentEllipseOrbit)
 {
     Init(argumentOfPerigee, inclination, rightAscensionOfAscendingNode, MomentEllipseOrbit);
 }