Home > Back-end >  Just learn c, a great god genuflect is begged come to guide the dispatch
Just learn c, a great god genuflect is begged come to guide the dispatch

Time:10-04

# include" stdafx. H
"#include
#include
#include
#include
using namespace std;
Int main ()
{
Double a [7] [4];
Ifstream in;
In the open (" D: \ GNSS. TXT ");
while (! In the eof ())
{the for (int I=0; I<7. I++)
for(int j=0; j<4. J++)
{in> A, [I] [j].
Cout}
in.close();
Double A;
A=pow (A [1] [3], 2);//1 calculation semi-major axis orbit
Cout<& lt;" Long orbit radius: "& lt;
Double n0.
Const double u=3.986004418 e14;//the earth's gravitational field constant
N0=SQRT (u/pow (A, 3));//2 to calculate the average movement velocity
Cout<& lt;" The average angular velocity campaign: "& lt;
Double t, tm, tk;
Cin>" The time when the signal emission: "& gt;> t;
Tm=a [2] [0];
Tk=t - tm;
If (tk> 302400)
Cout<& lt;" Relative to the reference epoch ephemeris time: "& lt; Else if (tk<- 302400)
Cout<& lt;" Relative to the reference epoch ephemeris time: "& lt; The else cout<& lt;" Relative to the reference epoch ephemeris time: "& lt;
Double n, Δ n;
Δ n=a [0] [2].
N=n0 + Δ n;
Cout<& lt;" N="& lt;
Double M0, Mk;
M0=a [0] [3].
Mk=M0 + n * tk;
Cout<& lt;" Flat anomaly: "& lt;
Double e, Ek, Ek1;
E=a [1] [1].
Ek=1;
Do
{
Ek1=Ek;
Ek=Mk + e * sin (Ek1);
} while (fabs (Ek - Ek1) & gt; 1 e - 15);
Cout<& lt;" Eccentric anomaly: "& lt;
Double vitamin k, p, q, r;
P=SQRT (1 - pow (e, 2)) * sin (Ek);
Q=1 - e * cos (Ek);
R=cos (Ek) - e;
Vitamin k=atan (p/q)/(r/q);
Cout<& lt;" True anomaly: "& lt;
Double Φ k, w;
W=a [3] [2].
Φ k=vitamin k + w;
Cout<& lt;" Rise of distance "& lt; <Φ k
Double zeta UK, zeta fairly rk, zeta ik.
Double cus, cuc, CRS, CRC, cis, cic;
Cus=a [1] [2], cuc=[1] a [0].
CRS=a [0] [1], the CRC=a [3] [1].
Cis=a [2] [3], cic=a [2] [1].
Zeta UK=cus * sin (2 * Φ k) + cuc * cos (2 * Φ k);
Zeta fairly rk=CRS * sin (2 * Φ k) + CRC * cos (2 * Φ k);
Zeta ik=cis * sin (2 * Φ k) + cic * cos (2 * Φ k);
Cout<& lt;" Rise Angle away from the correct number: "& lt; Cout<& lt;" Diameter to the correct number: "& lt; Cout<& lt;" Number of orbit inclination correction: "& lt;
Double the UK;
UK=Φ k + zeta UK;
Cout<& lt;" After correction of litres of pitch: "& lt;
Double fairly rk.
Fairly rk=A * (1 - e * cos (Ek)) + zeta fairly rk.
Cout<& lt;" After correction of the diameter: "& lt;
Double ik, i0 IDOT;
I0=a [3] [0].
IDOT=a [4] [0];
Ik="+ zeta ik + IDOT * tk;
Cout<& lt;" After correction of orbital inclination: "& lt;
Double xk1 yk1;
Xk1=fairly rk * cos (UK);
Yk1=fairly rk * sin (UK);
Cout<& lt;" The location of the satellite in orbit plane: "& lt;
Double Ω k, Ω 0, Ω t, toe;
Toe=a [2] [0];
Const double Ω e=7.292115 e-5;//the earth's rotation speed
Ω 0=a [2] [2].
Ω t=a [3] [3].
Ω k=Ω 0 + (Ω t - Ω e) * tk + Ω e * toe;
Cout<& lt;" After correcting the longitude of ascending node: "& lt; <Ω k
Double xk, yk, zk;
Xk=xk1 * cos (Ω k) - yk1 * cos (ik) * sin (Ω k);
Yk=xk1 * sin (Ω k) - yk1 * cos (ik) * cos (Ω k);
Zk=yk1 * sin (ik);
Cout<& lt;" In the position of the fixed coordinates: "& lt; & lt;" Xk="& lt; CodePudding user response:

The Greek letter variable name is not support, you switch to English

CodePudding user response:

Double n, Δ n;
Δ n=a [0] [2].
N=n0 + Δ n;

Δ n for all (letter + number)
  • Related