Home > Back-end >  The same object attribute data transmission between the different methods when the error, what reaso
The same object attribute data transmission between the different methods when the error, what reaso

Time:09-26

The following is a code
#include
#include
using namespace std;

Const long double GM=3.9860047 e14;
Const double We=7.292115 e-5;

The class Sate
{
Public:
Void the Pre (double t [7]);
Void Cal (Sate a, double t [7]);
Void CEs (Sate a);
Void the Cf (Sate a);
Void Cu (Sate a);
Void CDeltaU Sate (a);
Void CDeltaR Sate (a);
Void CDeltaI Sate (a);
Void CChanU Sate (a);
Void CChanR Sate (a);
Void CChanI Sate (a);
Cx (Sate a void);
Void Cy (Sate a);
Void CL (Sate a);
CX (Sate a void);
Void CY (Sate a);
Void CZ (Sate a);
Void the Display (void);
Private:
Double t [7];
Double t0;
Double SqrtA;//3-4
Double DeltaN;//2-3
Double n0.
Double n;
Double M0.//2-4
Double M;
Double TOE;//4-1
Double es.//3-2
Double w;//5-3
Double Cuc;//3-1
Double Cus.//3-3
Double Crc;//5-2
Double Crs.//2-2
Double Cic;//4-2
Double Cis;//4-4
Double i0;//5-1
Double DeltaI0;//6-1
Double OmegaTOE;//4-3
Double DeltaOmega;//5-4
Double GPSWeek;
Double L;
Double Es.
Double f;
Double u;
Double DeltaU;
Double DeltaR.
Double DeltaI;
Double ChanU;
Double ChanR;
Double ChanI;
Double x;
Double y;
Double X;
Double Y;
Double Z;
};

Void Sate: : Pre (double t [7])
{
Errno_t err;
FILE *fp;
Err=fopen_s (& amp; Fp, 00052731.98 N "r", "+");
If (err!=0) {
Cout & lt; <"Can a ` t open the file!" The exit (1);
}
Double x [7], m;
Double Para [31];
Int Judge=6;
While (Judge) {
Judge=6;
For (int I=0; i <7. I++) {
Lf fscanf_s (fp, "%", & amp; X [I]);
If (I==0) continue;
If (x==[I] t [I]) Judge -;
}
If (Judge)
For (int n=0; N & lt; 31; Lf n++) fscanf_s (fp, "%", & amp; M);
}
For (int n=0; N & lt; 31; N++) {
Lf fscanf_s (fp, "%", & amp; Para [n]); Cout & lt; }

T0=GPSWeek [5] * 3600 * 604800 + t + t [6] [7] * 60 + t;
SqrtA=Para [10].//3-4
DeltaN=Para [5];//2-3
M0=Para [6].//2-4
TOE=Para [11];//4-1
Es=Para [8];//3-2
W=Para [17];//5-3

Cuc=Para [7];//3-1
Cus=Para [9].//3-3
Crc=Para [16].//5-2
Crs=Para [4];//2-2
Cic=Para [12].//4-2
Cis=Para [14].//4-4
I0=Para [15].//5-1
DeltaI0=Para [19].//6-1
OmegaTOE=Para [13].//4-3
DeltaOmega=Para [18];//5-4
GPSWeek=Para [21].
//t get all the parameters according to the
//below calculate
Double n0=SQRT (GM)/pow (SqrtA, 3);
Double n=n0 + DeltaN;//2-3
Double M=M0 + n * (t0 - TOE);
Double Omega=OmegaTOE + DeltaOmega * TOE;
Double L=OmegaTOE + (DeltaOmega - We) * t0 - DeltaOmega * TOE;
}

Void Sate: : Cal (Sate a, double t [7])
{
//get parameter
CEs (a);
Cf (a);
Cu (a);
CDeltaU (a);
CDeltaR (a);
CDeltaI (a);
CChanU (a);
CChanR (a);
CChanI (a);
Cx (a);
Cy (a);
CX (a);
CY (a);
CZ (a);
}

Void Sate: : CEs (Sate a)
{
Double E0=arjun 0, Es, temp. Cout & lt; <"G=" & lt; Do {
Es=arjun 0 + a.e s * sin (E0);
Temp=E0;
E0=Es;
} while (fabs (temp - E0) & gt; E=1-12); Cout & lt; <"E0=" & lt; A.E s=E0;
Cout & lt; <" A.E s="& lt; }


Void Sate: : Cf (Sate a)
{
A.f=a cosine ((cos (a.E s) - a.E s)/(1 - a.E s * cos (a.E s)));
Cout & lt; <"A.f=" & lt; }

Void Sate: : Cu (Sate a)
{
Cout & lt; <" A.f="& lt; A.u=a.f aleem walji +;
Cout & lt; <"A.u=" & lt; }

Void Sate: : CDeltaU Sate (a)
{
A. d. eltaU=Cuc * cos (2 * u) + Cus * sin (2 * u);
Cout & lt; <"A. d. eltaU=" & lt; }

Void Sate: : CDeltaR Sate (a)
{
A. d. eltaR=Crc * cos (2 * u) + Crs * sin (2 * u);
Cout & lt; <"A. d. eltaR=" & lt; }

Void Sate: : CDeltaI Sate (a)
{
A. d. eltaI=Cic * cos (2 * u) + Cis * sin (2 * u);
Cout & lt; <"A. d. eltaI=" & lt; }

Void Sate: : CChanU Sate (a)
{
A.C hanU=u + DeltaU;
Cout & lt; <"A.C ChanU=" & lt; }

Void Sate: : CChanR Sate (a)
{
Double m=a.S qrtA * a.S qrtA;
A.C hanR=m * (1 - a.e s * cos (a.e s) + a. d. eltaR);
Cout & lt; <"A.C hanR=" & lt; }

Void Sate: : CChanI Sate (a)
{
A.C hanI=Anderson, 0 + a. d. eltaI + a. d. eltaI0 * (a.t 0 - a.t OE);
Cout & lt; <"A.C hanI=" & lt; }

Cx (Sate void Sate: : a)
{
A.x=a.C hanR * cos (a.C hanU);
Cout & lt; <"A.x=" & lt; }

Void Sate: : Cy (Sate a)
{
A.y=a.C hanR * sin (a.C hanU);
Cout & lt; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related