@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | /* Returns sign of a float */ |
23 | 23 | public static function Sign($arg) |
24 | 24 | { |
25 | - if ($arg > 0 ) { |
|
25 | + if ($arg > 0) { |
|
26 | 26 | return 1; |
27 | - } else if ($arg < 0 ) { |
|
27 | + } else if ($arg < 0) { |
|
28 | 28 | return -1; |
29 | 29 | } else { |
30 | 30 | return 0; |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | /* Returns the arcsine of the argument */ |
35 | 35 | public static function ArcSin($arg) |
36 | 36 | { |
37 | - if (abs($arg) >= 1 ) { |
|
38 | - return (self::Sign($arg) * Predict::pio2); |
|
37 | + if (abs($arg) >= 1) { |
|
38 | + return (self::Sign($arg)*Predict::pio2); |
|
39 | 39 | } else { |
40 | - return(atan($arg / sqrt(1 - $arg * $arg))); |
|
40 | + return(atan($arg/sqrt(1 - $arg*$arg))); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $v3->y = $v1->y + $v2->y; |
55 | 55 | $v3->z = $v1->z + $v2->z; |
56 | 56 | |
57 | - $v3->w = sqrt($v3->x * $v3->x + $v3->y * $v3->y + $v3->z * $v3->z); |
|
57 | + $v3->w = sqrt($v3->x*$v3->x + $v3->y*$v3->y + $v3->z*$v3->z); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /* Subtracts vector v2 from v1 to produce v3 */ |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | $v3->y = $v1->y - $v2->y; |
65 | 65 | $v3->z = $v1->z - $v2->z; |
66 | 66 | |
67 | - $v3->w = sqrt($v3->x * $v3->x + $v3->y * $v3->y + $v3->z * $v3->z); |
|
67 | + $v3->w = sqrt($v3->x*$v3->x + $v3->y*$v3->y + $v3->z*$v3->z); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /* Multiplies the vector v1 by the scalar k to produce the vector v2 */ |
71 | 71 | public static function Scalar_Multiply($k, Predict_Vector $v1, Predict_Vector $v2) |
72 | 72 | { |
73 | - $v2->x = $k * $v1->x; |
|
74 | - $v2->y = $k * $v1->y; |
|
75 | - $v2->z = $k * $v1->z; |
|
76 | - $v2->w = abs($k) * $v1->w; |
|
73 | + $v2->x = $k*$v1->x; |
|
74 | + $v2->y = $k*$v1->y; |
|
75 | + $v2->z = $k*$v1->z; |
|
76 | + $v2->w = abs($k)*$v1->w; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /* Multiplies the vector v1 by the scalar k */ |
@@ -83,35 +83,35 @@ discard block |
||
83 | 83 | $v->y *= $k; |
84 | 84 | $v->z *= $k; |
85 | 85 | |
86 | - $v->w = sqrt($v->x * $v->x + $v->y * $v->y + $v->z * $v->z); |
|
86 | + $v->w = sqrt($v->x*$v->x + $v->y*$v->y + $v->z*$v->z); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /* Returns the dot product of two vectors */ |
90 | 90 | public static function Dot(Predict_Vector $v1, Predict_Vector $v2) |
91 | 91 | { |
92 | - return ($v1->x * $v2->x + $v1->y * $v2->y + $v1->z * $v2->z); |
|
92 | + return ($v1->x*$v2->x + $v1->y*$v2->y + $v1->z*$v2->z); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /* Calculates the angle between vectors v1 and v2 */ |
96 | 96 | public static function Angle(Predict_Vector $v1, Predict_Vector $v2) |
97 | 97 | { |
98 | - $v1->w = sqrt($v1->x * $v1->x + $v1->y * $v1->y + $v1->z * $v1->z); |
|
99 | - $v2->w = sqrt($v2->x * $v2->x + $v2->y * $v2->y + $v2->z * $v2->z); |
|
100 | - return (self::ArcCos(self::Dot($v1, $v2) / ($v1->w * $v2->w))); |
|
98 | + $v1->w = sqrt($v1->x*$v1->x + $v1->y*$v1->y + $v1->z*$v1->z); |
|
99 | + $v2->w = sqrt($v2->x*$v2->x + $v2->y*$v2->y + $v2->z*$v2->z); |
|
100 | + return (self::ArcCos(self::Dot($v1, $v2)/($v1->w*$v2->w))); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /* Produces cross product of v1 and v2, and returns in v3 */ |
104 | - public static function Cross(Predict_Vector $v1, Predict_Vector $v2 ,Predict_Vector $v3) |
|
104 | + public static function Cross(Predict_Vector $v1, Predict_Vector $v2, Predict_Vector $v3) |
|
105 | 105 | { |
106 | - $v3->x = $v1->y * $v2->z - $v1->z * $v2->y; |
|
107 | - $v3->y = $v1->z * $v2->x - $v1->x * $v2->z; |
|
108 | - $v3->z = $v1->x * $v2->y - $v1->y * $v2->x; |
|
106 | + $v3->x = $v1->y*$v2->z - $v1->z*$v2->y; |
|
107 | + $v3->y = $v1->z*$v2->x - $v1->x*$v2->z; |
|
108 | + $v3->z = $v1->x*$v2->y - $v1->y*$v2->x; |
|
109 | 109 | |
110 | - $v3->w = sqrt($v3->x * $v3->x + $v3->y * $v3->y + $v3->z * $v3->z); |
|
110 | + $v3->w = sqrt($v3->x*$v3->x + $v3->y*$v3->y + $v3->z*$v3->z); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /* Normalizes a vector */ |
114 | - public static function Normalize(Predict_Vector $v ) |
|
114 | + public static function Normalize(Predict_Vector $v) |
|
115 | 115 | { |
116 | 116 | $v->x /= $v->w; |
117 | 117 | $v->y /= $v->w; |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | } else { |
131 | 131 | if ($cosx > 0) { |
132 | 132 | if ($sinx > 0) { |
133 | - return atan($sinx / $cosx); |
|
133 | + return atan($sinx/$cosx); |
|
134 | 134 | } else { |
135 | - return Predict::twopi + atan($sinx / $cosx); |
|
135 | + return Predict::twopi + atan($sinx/$cosx); |
|
136 | 136 | } |
137 | 137 | } else { |
138 | - return Predict::pi + atan($sinx / $cosx); |
|
138 | + return Predict::pi + atan($sinx/$cosx); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | } |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | public static function FMod2p($x) |
145 | 145 | { |
146 | 146 | $ret_val = $x; |
147 | - $i = (int) ($ret_val / Predict::twopi); |
|
148 | - $ret_val -= $i * Predict::twopi; |
|
147 | + $i = (int) ($ret_val/Predict::twopi); |
|
148 | + $ret_val -= $i*Predict::twopi; |
|
149 | 149 | |
150 | 150 | if ($ret_val < 0) { |
151 | 151 | $ret_val += Predict::twopi; |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | public static function Modulus($arg1, $arg2) |
159 | 159 | { |
160 | 160 | $ret_val = $arg1; |
161 | - $i = (int) ($ret_val / $arg2); |
|
162 | - $ret_val -= $i * $arg2; |
|
161 | + $i = (int) ($ret_val/$arg2); |
|
162 | + $ret_val -= $i*$arg2; |
|
163 | 163 | |
164 | 164 | if ($ret_val < 0) { |
165 | 165 | $ret_val += $arg2; |
@@ -179,18 +179,18 @@ discard block |
||
179 | 179 | public static function Convert_Sat_State(Predict_Vector $pos, Predict_Vector $vel) |
180 | 180 | { |
181 | 181 | self::Scale_Vector(Predict::xkmper, $pos); |
182 | - self::Scale_Vector(Predict::xkmper * Predict::xmnpda / Predict::secday, $vel); |
|
182 | + self::Scale_Vector(Predict::xkmper*Predict::xmnpda/Predict::secday, $vel); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /* Returns angle in radians from arg in degrees */ |
186 | 186 | public static function Radians($arg) |
187 | 187 | { |
188 | - return $arg * Predict::de2ra; |
|
188 | + return $arg*Predict::de2ra; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /* Returns angle in degrees from arg in rads */ |
192 | 192 | public static function Degrees($arg) |
193 | 193 | { |
194 | - return $arg / Predict::de2ra; |
|
194 | + return $arg/Predict::de2ra; |
|
195 | 195 | } |
196 | 196 | } |
@@ -28,25 +28,25 @@ discard block |
||
28 | 28 | public static function Calculate_Solar_Position($time, Predict_Vector $solar_vector) |
29 | 29 | { |
30 | 30 | $mjd = $time - 2415020.0; |
31 | - $year = 1900 + $mjd / 365.25; |
|
32 | - $T = ($mjd + Predict_Time::Delta_ET($year) / Predict::secday) / 36525.0; |
|
33 | - $M = Predict_Math::Radians(Predict_Math::Modulus(358.47583 + Predict_Math::Modulus(35999.04975 * $T, 360.0) |
|
34 | - - (0.000150 + 0.0000033 * $T) * ($T * $T), 360.0)); |
|
35 | - $L = Predict_Math::Radians(Predict_Math::Modulus(279.69668 + Predict_Math::Modulus(36000.76892 * $T, 360.0) |
|
36 | - + 0.0003025 * ($T * $T), 360.0)); |
|
37 | - $e = 0.01675104 - (0.0000418 + 0.000000126 * $T) * $T; |
|
38 | - $C = Predict_Math::Radians((1.919460 - (0.004789 + 0.000014 * $T) * $T) * sin($M) |
|
39 | - + (0.020094 - 0.000100 * $T) * sin(2 * $M) + 0.000293 * sin(3 * $M)); |
|
40 | - $O = Predict_Math::Radians(Predict_Math::Modulus(259.18 - 1934.142 * $T, 360.0)); |
|
41 | - $Lsa = Predict_Math::Modulus($L + $C - Predict_Math::Radians(0.00569 - 0.00479 * sin($O)), Predict::twopi); |
|
31 | + $year = 1900 + $mjd/365.25; |
|
32 | + $T = ($mjd + Predict_Time::Delta_ET($year)/Predict::secday)/36525.0; |
|
33 | + $M = Predict_Math::Radians(Predict_Math::Modulus(358.47583 + Predict_Math::Modulus(35999.04975*$T, 360.0) |
|
34 | + - (0.000150 + 0.0000033*$T)*($T*$T), 360.0)); |
|
35 | + $L = Predict_Math::Radians(Predict_Math::Modulus(279.69668 + Predict_Math::Modulus(36000.76892*$T, 360.0) |
|
36 | + + 0.0003025*($T*$T), 360.0)); |
|
37 | + $e = 0.01675104 - (0.0000418 + 0.000000126*$T)*$T; |
|
38 | + $C = Predict_Math::Radians((1.919460 - (0.004789 + 0.000014*$T)*$T)*sin($M) |
|
39 | + + (0.020094 - 0.000100*$T)*sin(2*$M) + 0.000293*sin(3*$M)); |
|
40 | + $O = Predict_Math::Radians(Predict_Math::Modulus(259.18 - 1934.142*$T, 360.0)); |
|
41 | + $Lsa = Predict_Math::Modulus($L + $C - Predict_Math::Radians(0.00569 - 0.00479*sin($O)), Predict::twopi); |
|
42 | 42 | $nu = Predict_Math::Modulus($M + $C, Predict::twopi); |
43 | - $R = 1.0000002 * (1 - ($e * $e)) / (1 + $e * cos($nu)); |
|
44 | - $eps = Predict_Math::Radians(23.452294 - (0.0130125 + (0.00000164 - 0.000000503 * $T) * $T) * $T + 0.00256 * cos($O)); |
|
45 | - $R = Predict::AU * $R; |
|
43 | + $R = 1.0000002*(1 - ($e*$e))/(1 + $e*cos($nu)); |
|
44 | + $eps = Predict_Math::Radians(23.452294 - (0.0130125 + (0.00000164 - 0.000000503*$T)*$T)*$T + 0.00256*cos($O)); |
|
45 | + $R = Predict::AU*$R; |
|
46 | 46 | |
47 | - $solar_vector->x = $R * cos($Lsa); |
|
48 | - $solar_vector->y = $R * sin($Lsa) * cos($eps); |
|
49 | - $solar_vector->z = $R * sin($Lsa) * sin($eps); |
|
47 | + $solar_vector->x = $R*cos($Lsa); |
|
48 | + $solar_vector->y = $R*sin($Lsa)*cos($eps); |
|
49 | + $solar_vector->z = $R*sin($Lsa)*sin($eps); |
|
50 | 50 | $solar_vector->w = $R; |
51 | 51 | } |
52 | 52 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | $earth = new Predict_Vector(); |
58 | 58 | |
59 | 59 | /* Determine partial eclipse */ |
60 | - $sd_earth = Predict_Math::ArcSin(Predict::xkmper / $pos->w); |
|
60 | + $sd_earth = Predict_Math::ArcSin(Predict::xkmper/$pos->w); |
|
61 | 61 | Predict_Math::Vec_Sub($sol, $pos, $Rho); |
62 | - $sd_sun = Predict_Math::ArcSin(Predict::__sr__ / $Rho->w); |
|
62 | + $sd_sun = Predict_Math::ArcSin(Predict::__sr__/$Rho->w); |
|
63 | 63 | Predict_Math::Scalar_Multiply(-1, $pos, $earth); |
64 | 64 | $delta = Predict_Math::Angle($sol, $earth); |
65 | 65 | $depth = $sd_earth - $sd_sun - $delta; |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $obs_geodetic = new Predict_Geodetic(); |
91 | - $obs_geodetic->lon = $qth->lon * Predict::de2ra; |
|
92 | - $obs_geodetic->lat = $qth->lat * Predict::de2ra; |
|
93 | - $obs_geodetic->alt = $qth->alt / 1000.0; |
|
91 | + $obs_geodetic->lon = $qth->lon*Predict::de2ra; |
|
92 | + $obs_geodetic->lat = $qth->lat*Predict::de2ra; |
|
93 | + $obs_geodetic->alt = $qth->alt/1000.0; |
|
94 | 94 | $obs_geodetic->theta = 0; |
95 | 95 | |
96 | 96 | $solar_vector = new Predict_Vector(); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | /* orbit_type_t struct */ |
44 | 44 | const ORBIT_TYPE_UNKNOWN = 0; |
45 | - const ORBIT_TYPE_LEO = 1; /*!< Low Earth orbit, up to 1200 km. */ |
|
46 | - const ORBIT_TYPE_ICO = 2; /*!< Intermediate Circular Orbit, up to 1400 km. */ |
|
47 | - const ORBIT_TYPE_GEO = 3; /*!< Geostationary. */ |
|
48 | - const ORBIT_TYPE_GSO = 4; /*!< Geosynchronuous. */ |
|
45 | + const ORBIT_TYPE_LEO = 1; /*!< Low Earth orbit, up to 1200 km. */ |
|
46 | + const ORBIT_TYPE_ICO = 2; /*!< Intermediate Circular Orbit, up to 1400 km. */ |
|
47 | + const ORBIT_TYPE_GEO = 3; /*!< Geostationary. */ |
|
48 | + const ORBIT_TYPE_GSO = 4; /*!< Geosynchronuous. */ |
|
49 | 49 | const ORBIT_TYPE_MOLNIYA = 5; |
50 | 50 | const ORBIT_TYPE_TUNDRA = 6; |
51 | 51 | const ORBIT_TYPE_POLAR = 7; |
@@ -70,29 +70,29 @@ discard block |
||
70 | 70 | public function SGP4(Predict_Sat $sat, $tsince) |
71 | 71 | { |
72 | 72 | /* Initialization */ |
73 | - if (~$sat->flags & self::SGP4_INITIALIZED_FLAG) { |
|
73 | + if (~$sat->flags&self::SGP4_INITIALIZED_FLAG) { |
|
74 | 74 | $sat->flags |= self::SGP4_INITIALIZED_FLAG; |
75 | 75 | |
76 | 76 | /* Recover original mean motion (xnodp) and */ |
77 | 77 | /* semimajor axis (aodp) from input elements. */ |
78 | - $a1 = pow(Predict::xke / $sat->tle->xno, Predict::tothrd); |
|
78 | + $a1 = pow(Predict::xke/$sat->tle->xno, Predict::tothrd); |
|
79 | 79 | $sat->sgps->cosio = cos($sat->tle->xincl); |
80 | - $theta2 = $sat->sgps->cosio * $sat->sgps->cosio; |
|
81 | - $sat->sgps->x3thm1 = 3 * $theta2 - 1.0; |
|
82 | - $eosq = $sat->tle->eo * $sat->tle->eo; |
|
80 | + $theta2 = $sat->sgps->cosio*$sat->sgps->cosio; |
|
81 | + $sat->sgps->x3thm1 = 3*$theta2 - 1.0; |
|
82 | + $eosq = $sat->tle->eo*$sat->tle->eo; |
|
83 | 83 | $betao2 = 1 - $eosq; |
84 | 84 | $betao = sqrt($betao2); |
85 | - $del1 = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / ($a1 * $a1 * $betao * $betao2); |
|
86 | - $ao = $a1 * (1 - $del1 * (0.5 * Predict::tothrd + $del1 * (1 + 134.0 / 81.0 * $del1))); |
|
87 | - $delo = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / ($ao * $ao * $betao * $betao2); |
|
88 | - $sat->sgps->xnodp = $sat->tle->xno / (1.0 + $delo); |
|
89 | - $sat->sgps->aodp = $ao / (1.0 - $delo); |
|
85 | + $del1 = 1.5*Predict::ck2*$sat->sgps->x3thm1/($a1*$a1*$betao*$betao2); |
|
86 | + $ao = $a1*(1 - $del1*(0.5*Predict::tothrd + $del1*(1 + 134.0/81.0*$del1))); |
|
87 | + $delo = 1.5*Predict::ck2*$sat->sgps->x3thm1/($ao*$ao*$betao*$betao2); |
|
88 | + $sat->sgps->xnodp = $sat->tle->xno/(1.0 + $delo); |
|
89 | + $sat->sgps->aodp = $ao/(1.0 - $delo); |
|
90 | 90 | |
91 | 91 | /* For perigee less than 220 kilometers, the "simple" flag is set */ |
92 | 92 | /* and the equations are truncated to linear variation in sqrt a */ |
93 | 93 | /* and quadratic variation in mean anomaly. Also, the c3 term, */ |
94 | 94 | /* the delta omega term, and the delta m term are dropped. */ |
95 | - if (($sat->sgps->aodp * (1.0 - $sat->tle->eo) / Predict::ae) < (220.0 / Predict::xkmper + Predict::ae)) { |
|
95 | + if (($sat->sgps->aodp*(1.0 - $sat->tle->eo)/Predict::ae) < (220.0/Predict::xkmper + Predict::ae)) { |
|
96 | 96 | $sat->flags |= self::SIMPLE_FLAG; |
97 | 97 | } else { |
98 | 98 | $sat->flags &= ~self::SIMPLE_FLAG; |
@@ -102,121 +102,121 @@ discard block |
||
102 | 102 | /* values of s and qoms2t are altered. */ |
103 | 103 | $s4 = Predict::__s__; |
104 | 104 | $qoms24 = Predict::qoms2t; |
105 | - $perige = ($sat->sgps->aodp * (1 - $sat->tle->eo) - Predict::ae) * Predict::xkmper; |
|
105 | + $perige = ($sat->sgps->aodp*(1 - $sat->tle->eo) - Predict::ae)*Predict::xkmper; |
|
106 | 106 | if ($perige < 156.0) { |
107 | 107 | if ($perige <= 98.0) { |
108 | 108 | $s4 = 20.0; |
109 | 109 | } else { |
110 | 110 | $s4 = $perige - 78.0; |
111 | 111 | } |
112 | - $qoms24 = pow((120.0 - $s4) * Predict::ae / Predict::xkmper, 4); |
|
113 | - $s4 = $s4 / Predict::xkmper + Predict::ae; |
|
112 | + $qoms24 = pow((120.0 - $s4)*Predict::ae/Predict::xkmper, 4); |
|
113 | + $s4 = $s4/Predict::xkmper + Predict::ae; |
|
114 | 114 | }; /* FIXME FIXME: End of if(perige <= 98) NO WAY!!!! */ |
115 | 115 | |
116 | - $pinvsq = 1.0 / ($sat->sgps->aodp * $sat->sgps->aodp * $betao2 * $betao2); |
|
117 | - $tsi = 1.0 / ($sat->sgps->aodp - $s4); |
|
118 | - $sat->sgps->eta = $sat->sgps->aodp * $sat->tle->eo * $tsi; |
|
119 | - $etasq = $sat->sgps->eta * $sat->sgps->eta; |
|
120 | - $eeta = $sat->tle->eo * $sat->sgps->eta; |
|
116 | + $pinvsq = 1.0/($sat->sgps->aodp*$sat->sgps->aodp*$betao2*$betao2); |
|
117 | + $tsi = 1.0/($sat->sgps->aodp - $s4); |
|
118 | + $sat->sgps->eta = $sat->sgps->aodp*$sat->tle->eo*$tsi; |
|
119 | + $etasq = $sat->sgps->eta*$sat->sgps->eta; |
|
120 | + $eeta = $sat->tle->eo*$sat->sgps->eta; |
|
121 | 121 | $psisq = abs(1.0 - $etasq); |
122 | - $coef = $qoms24 * pow($tsi, 4); |
|
123 | - $coef1 = $coef / pow($psisq, 3.5); |
|
124 | - $c2 = $coef1 * $sat->sgps->xnodp * ($sat->sgps->aodp * |
|
125 | - (1.0 + 1.5 * $etasq + $eeta * (4.0 + $etasq)) + |
|
126 | - 0.75 * Predict::ck2 * $tsi / $psisq * $sat->sgps->x3thm1 * |
|
127 | - (8.0 + 3.0 * $etasq * (8 + $etasq))); |
|
128 | - $sat->sgps->c1 = $c2 * $sat->tle->bstar; |
|
122 | + $coef = $qoms24*pow($tsi, 4); |
|
123 | + $coef1 = $coef/pow($psisq, 3.5); |
|
124 | + $c2 = $coef1*$sat->sgps->xnodp*($sat->sgps->aodp* |
|
125 | + (1.0 + 1.5*$etasq + $eeta*(4.0 + $etasq)) + |
|
126 | + 0.75*Predict::ck2*$tsi/$psisq*$sat->sgps->x3thm1* |
|
127 | + (8.0 + 3.0*$etasq*(8 + $etasq))); |
|
128 | + $sat->sgps->c1 = $c2*$sat->tle->bstar; |
|
129 | 129 | $sat->sgps->sinio = sin($sat->tle->xincl); |
130 | - $a3ovk2 = -Predict::xj3 / Predict::ck2 * pow(Predict::ae, 3); |
|
131 | - $c3 = $coef * $tsi * $a3ovk2 * $sat->sgps->xnodp * Predict::ae * $sat->sgps->sinio / $sat->tle->eo; |
|
130 | + $a3ovk2 = -Predict::xj3/Predict::ck2*pow(Predict::ae, 3); |
|
131 | + $c3 = $coef*$tsi*$a3ovk2*$sat->sgps->xnodp*Predict::ae*$sat->sgps->sinio/$sat->tle->eo; |
|
132 | 132 | $sat->sgps->x1mth2 = 1.0 - $theta2; |
133 | - $sat->sgps->c4 = 2.0 * $sat->sgps->xnodp * $coef1 * $sat->sgps->aodp * $betao2 * |
|
134 | - ($sat->sgps->eta * (2.0 + 0.5 * $etasq) + |
|
135 | - $sat->tle->eo * (0.5 + 2.0 * $etasq) - |
|
136 | - 2.0 * Predict::ck2 * $tsi / ($sat->sgps->aodp * $psisq) * |
|
137 | - (-3.0 * $sat->sgps->x3thm1 * (1.0 - 2.0 * $eeta + $etasq * (1.5 - 0.5 * $eeta)) + |
|
138 | - 0.75 * $sat->sgps->x1mth2 * (2.0 * $etasq - $eeta * (1.0 + $etasq)) * |
|
139 | - cos(2.0 * $sat->tle->omegao))); |
|
140 | - $sat->sgps->c5 = 2.0 * $coef1 * $sat->sgps->aodp * $betao2 * |
|
141 | - (1.0 + 2.75 * ($etasq + $eeta) + $eeta * $etasq); |
|
142 | - $theta4 = $theta2 * $theta2; |
|
143 | - $temp1 = 3.0 * Predict::ck2 * $pinvsq * $sat->sgps->xnodp; |
|
144 | - $temp2 = $temp1 * Predict::ck2 * $pinvsq; |
|
145 | - $temp3 = 1.25 * Predict::ck4 * $pinvsq * $pinvsq * $sat->sgps->xnodp; |
|
146 | - $sat->sgps->xmdot = $sat->sgps->xnodp + 0.5 * $temp1 * $betao * $sat->sgps->x3thm1 + |
|
147 | - 0.0625 * $temp2 * $betao * (13.0 - 78.0 * $theta2 + 137.0 * $theta4); |
|
148 | - $x1m5th = 1.0 - 5.0 * $theta2; |
|
149 | - $sat->sgps->omgdot = -0.5 * $temp1 * $x1m5th + |
|
150 | - 0.0625 * $temp2 * (7.0 - 114.0 * $theta2 + 395.0 * $theta4) + |
|
151 | - $temp3 * (3.0 - 36.0 * $theta2 + 49.0 * $theta4); |
|
152 | - $xhdot1 = -$temp1 * $sat->sgps->cosio; |
|
153 | - $sat->sgps->xnodot = $xhdot1 + (0.5 * $temp2 * (4.0 - 19.0 * $theta2) + |
|
154 | - 2.0 * $temp3 * (3.0 - 7.0 * $theta2)) * $sat->sgps->cosio; |
|
155 | - $sat->sgps->omgcof = $sat->tle->bstar * $c3 * cos($sat->tle->omegao); |
|
156 | - $sat->sgps->xmcof = -Predict::tothrd * $coef * $sat->tle->bstar * Predict::ae / $eeta; |
|
157 | - $sat->sgps->xnodcf = 3.5 * $betao2 * $xhdot1 * $sat->sgps->c1; |
|
158 | - $sat->sgps->t2cof = 1.5 * $sat->sgps->c1; |
|
159 | - $sat->sgps->xlcof = 0.125 * $a3ovk2 * $sat->sgps->sinio * |
|
160 | - (3.0 + 5.0 * $sat->sgps->cosio) / (1.0 + $sat->sgps->cosio); |
|
161 | - $sat->sgps->aycof = 0.25 * $a3ovk2 * $sat->sgps->sinio; |
|
162 | - $sat->sgps->delmo = pow(1.0 + $sat->sgps->eta * cos($sat->tle->xmo), 3); |
|
133 | + $sat->sgps->c4 = 2.0*$sat->sgps->xnodp*$coef1*$sat->sgps->aodp*$betao2* |
|
134 | + ($sat->sgps->eta*(2.0 + 0.5*$etasq) + |
|
135 | + $sat->tle->eo*(0.5 + 2.0*$etasq) - |
|
136 | + 2.0*Predict::ck2*$tsi/($sat->sgps->aodp*$psisq)* |
|
137 | + (-3.0*$sat->sgps->x3thm1*(1.0 - 2.0*$eeta + $etasq*(1.5 - 0.5*$eeta)) + |
|
138 | + 0.75*$sat->sgps->x1mth2*(2.0*$etasq - $eeta*(1.0 + $etasq))* |
|
139 | + cos(2.0*$sat->tle->omegao))); |
|
140 | + $sat->sgps->c5 = 2.0*$coef1*$sat->sgps->aodp*$betao2* |
|
141 | + (1.0 + 2.75*($etasq + $eeta) + $eeta*$etasq); |
|
142 | + $theta4 = $theta2*$theta2; |
|
143 | + $temp1 = 3.0*Predict::ck2*$pinvsq*$sat->sgps->xnodp; |
|
144 | + $temp2 = $temp1*Predict::ck2*$pinvsq; |
|
145 | + $temp3 = 1.25*Predict::ck4*$pinvsq*$pinvsq*$sat->sgps->xnodp; |
|
146 | + $sat->sgps->xmdot = $sat->sgps->xnodp + 0.5*$temp1*$betao*$sat->sgps->x3thm1 + |
|
147 | + 0.0625*$temp2*$betao*(13.0 - 78.0*$theta2 + 137.0*$theta4); |
|
148 | + $x1m5th = 1.0 - 5.0*$theta2; |
|
149 | + $sat->sgps->omgdot = -0.5*$temp1*$x1m5th + |
|
150 | + 0.0625*$temp2*(7.0 - 114.0*$theta2 + 395.0*$theta4) + |
|
151 | + $temp3*(3.0 - 36.0*$theta2 + 49.0*$theta4); |
|
152 | + $xhdot1 = -$temp1*$sat->sgps->cosio; |
|
153 | + $sat->sgps->xnodot = $xhdot1 + (0.5*$temp2*(4.0 - 19.0*$theta2) + |
|
154 | + 2.0*$temp3*(3.0 - 7.0*$theta2))*$sat->sgps->cosio; |
|
155 | + $sat->sgps->omgcof = $sat->tle->bstar*$c3*cos($sat->tle->omegao); |
|
156 | + $sat->sgps->xmcof = -Predict::tothrd*$coef*$sat->tle->bstar*Predict::ae/$eeta; |
|
157 | + $sat->sgps->xnodcf = 3.5*$betao2*$xhdot1*$sat->sgps->c1; |
|
158 | + $sat->sgps->t2cof = 1.5*$sat->sgps->c1; |
|
159 | + $sat->sgps->xlcof = 0.125*$a3ovk2*$sat->sgps->sinio* |
|
160 | + (3.0 + 5.0*$sat->sgps->cosio)/(1.0 + $sat->sgps->cosio); |
|
161 | + $sat->sgps->aycof = 0.25*$a3ovk2*$sat->sgps->sinio; |
|
162 | + $sat->sgps->delmo = pow(1.0 + $sat->sgps->eta*cos($sat->tle->xmo), 3); |
|
163 | 163 | $sat->sgps->sinmo = sin($sat->tle->xmo); |
164 | - $sat->sgps->x7thm1 = 7.0 * $theta2 - 1.0; |
|
165 | - if (~$sat->flags & self::SIMPLE_FLAG) { |
|
166 | - $c1sq = $sat->sgps->c1 * $sat->sgps->c1; |
|
167 | - $sat->sgps->d2 = 4.0 * $sat->sgps->aodp * $tsi * $c1sq; |
|
168 | - $temp = $sat->sgps->d2 * $tsi * $sat->sgps->c1 / 3.0; |
|
169 | - $sat->sgps->d3 = (17.0 * $sat->sgps->aodp + $s4) * $temp; |
|
170 | - $sat->sgps->d4 = 0.5 * $temp * $sat->sgps->aodp * $tsi * |
|
171 | - (221.0 * $sat->sgps->aodp + 31.0 * $s4) * $sat->sgps->c1; |
|
172 | - $sat->sgps->t3cof = $sat->sgps->d2 + 2.0 * $c1sq; |
|
173 | - $sat->sgps->t4cof = 0.25 * (3.0 * $sat->sgps->d3 + $sat->sgps->c1 * |
|
174 | - (12.0 * $sat->sgps->d2 + 10.0 * $c1sq)); |
|
175 | - $sat->sgps->t5cof = 0.2 * (3.0 * $sat->sgps->d4 + |
|
176 | - 12.0 * $sat->sgps->c1 * $sat->sgps->d3 + |
|
177 | - 6.0 * $sat->sgps->d2 * $sat->sgps->d2 + |
|
178 | - 15.0 * $c1sq * (2.0 * $sat->sgps->d2 + $c1sq)); |
|
164 | + $sat->sgps->x7thm1 = 7.0*$theta2 - 1.0; |
|
165 | + if (~$sat->flags&self::SIMPLE_FLAG) { |
|
166 | + $c1sq = $sat->sgps->c1*$sat->sgps->c1; |
|
167 | + $sat->sgps->d2 = 4.0*$sat->sgps->aodp*$tsi*$c1sq; |
|
168 | + $temp = $sat->sgps->d2*$tsi*$sat->sgps->c1/3.0; |
|
169 | + $sat->sgps->d3 = (17.0*$sat->sgps->aodp + $s4)*$temp; |
|
170 | + $sat->sgps->d4 = 0.5*$temp*$sat->sgps->aodp*$tsi* |
|
171 | + (221.0*$sat->sgps->aodp + 31.0*$s4)*$sat->sgps->c1; |
|
172 | + $sat->sgps->t3cof = $sat->sgps->d2 + 2.0*$c1sq; |
|
173 | + $sat->sgps->t4cof = 0.25*(3.0*$sat->sgps->d3 + $sat->sgps->c1* |
|
174 | + (12.0*$sat->sgps->d2 + 10.0*$c1sq)); |
|
175 | + $sat->sgps->t5cof = 0.2*(3.0*$sat->sgps->d4 + |
|
176 | + 12.0*$sat->sgps->c1*$sat->sgps->d3 + |
|
177 | + 6.0*$sat->sgps->d2*$sat->sgps->d2 + |
|
178 | + 15.0*$c1sq*(2.0*$sat->sgps->d2 + $c1sq)); |
|
179 | 179 | }; /* End of if (isFlagClear(SIMPLE_FLAG)) */ |
180 | 180 | }; /* End of SGP4() initialization */ |
181 | 181 | |
182 | 182 | /* Update for secular gravity and atmospheric drag. */ |
183 | - $xmdf = $sat->tle->xmo + $sat->sgps->xmdot * $tsince; |
|
184 | - $omgadf = $sat->tle->omegao + $sat->sgps->omgdot * $tsince; |
|
185 | - $xnoddf = $sat->tle->xnodeo + $sat->sgps->xnodot * $tsince; |
|
183 | + $xmdf = $sat->tle->xmo + $sat->sgps->xmdot*$tsince; |
|
184 | + $omgadf = $sat->tle->omegao + $sat->sgps->omgdot*$tsince; |
|
185 | + $xnoddf = $sat->tle->xnodeo + $sat->sgps->xnodot*$tsince; |
|
186 | 186 | $omega = $omgadf; |
187 | 187 | $xmp = $xmdf; |
188 | - $tsq = $tsince * $tsince; |
|
189 | - $xnode = $xnoddf + $sat->sgps->xnodcf * $tsq; |
|
190 | - $tempa = 1.0 - $sat->sgps->c1 * $tsince; |
|
191 | - $tempe = $sat->tle->bstar * $sat->sgps->c4 * $tsince; |
|
192 | - $templ = $sat->sgps->t2cof * $tsq; |
|
193 | - if (~$sat->flags & self::SIMPLE_FLAG) { |
|
194 | - $delomg = $sat->sgps->omgcof * $tsince; |
|
195 | - $delm = $sat->sgps->xmcof * (pow(1 + $sat->sgps->eta * cos($xmdf), 3) - $sat->sgps->delmo); |
|
188 | + $tsq = $tsince*$tsince; |
|
189 | + $xnode = $xnoddf + $sat->sgps->xnodcf*$tsq; |
|
190 | + $tempa = 1.0 - $sat->sgps->c1*$tsince; |
|
191 | + $tempe = $sat->tle->bstar*$sat->sgps->c4*$tsince; |
|
192 | + $templ = $sat->sgps->t2cof*$tsq; |
|
193 | + if (~$sat->flags&self::SIMPLE_FLAG) { |
|
194 | + $delomg = $sat->sgps->omgcof*$tsince; |
|
195 | + $delm = $sat->sgps->xmcof*(pow(1 + $sat->sgps->eta*cos($xmdf), 3) - $sat->sgps->delmo); |
|
196 | 196 | $temp = $delomg + $delm; |
197 | 197 | $xmp = $xmdf + $temp; |
198 | 198 | $omega = $omgadf - $temp; |
199 | - $tcube = $tsq * $tsince; |
|
200 | - $tfour = $tsince * $tcube; |
|
201 | - $tempa = $tempa - $sat->sgps->d2 * $tsq - $sat->sgps->d3 * $tcube - $sat->sgps->d4 * $tfour; |
|
202 | - $tempe = $tempe + $sat->tle->bstar * $sat->sgps->c5 * (sin($xmp) - $sat->sgps->sinmo); |
|
203 | - $templ = $templ + $sat->sgps->t3cof * $tcube + $tfour * |
|
204 | - ($sat->sgps->t4cof + $tsince * $sat->sgps->t5cof); |
|
199 | + $tcube = $tsq*$tsince; |
|
200 | + $tfour = $tsince*$tcube; |
|
201 | + $tempa = $tempa - $sat->sgps->d2*$tsq - $sat->sgps->d3*$tcube - $sat->sgps->d4*$tfour; |
|
202 | + $tempe = $tempe + $sat->tle->bstar*$sat->sgps->c5*(sin($xmp) - $sat->sgps->sinmo); |
|
203 | + $templ = $templ + $sat->sgps->t3cof*$tcube + $tfour* |
|
204 | + ($sat->sgps->t4cof + $tsince*$sat->sgps->t5cof); |
|
205 | 205 | }; /* End of if (isFlagClear(SIMPLE_FLAG)) */ |
206 | 206 | |
207 | - $a = $sat->sgps->aodp * pow($tempa, 2); |
|
207 | + $a = $sat->sgps->aodp*pow($tempa, 2); |
|
208 | 208 | $e = $sat->tle->eo - $tempe; |
209 | - $xl = $xmp + $omega + $xnode + $sat->sgps->xnodp * $templ; |
|
210 | - $beta = sqrt(1.0 - ($e * $e)); |
|
211 | - $xn = Predict::xke / pow($a, 1.5); |
|
209 | + $xl = $xmp + $omega + $xnode + $sat->sgps->xnodp*$templ; |
|
210 | + $beta = sqrt(1.0 - ($e*$e)); |
|
211 | + $xn = Predict::xke/pow($a, 1.5); |
|
212 | 212 | |
213 | 213 | /* Long period periodics */ |
214 | - $axn = $e * cos($omega); |
|
215 | - $temp = 1.0 / ($a * $beta * $beta); |
|
216 | - $xll = $temp * $sat->sgps->xlcof * $axn; |
|
217 | - $aynl = $temp * $sat->sgps->aycof; |
|
214 | + $axn = $e*cos($omega); |
|
215 | + $temp = 1.0/($a*$beta*$beta); |
|
216 | + $xll = $temp*$sat->sgps->xlcof*$axn; |
|
217 | + $aynl = $temp*$sat->sgps->aycof; |
|
218 | 218 | $xlt = $xl + $xll; |
219 | - $ayn = $e * sin($omega) + $aynl; |
|
219 | + $ayn = $e*sin($omega) + $aynl; |
|
220 | 220 | |
221 | 221 | /* Solve Kepler's' Equation */ |
222 | 222 | $capu = Predict_Math::FMod2p($xlt - $xnode); |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | do { |
227 | 227 | $sinepw = sin($temp2); |
228 | 228 | $cosepw = cos($temp2); |
229 | - $temp3 = $axn * $sinepw; |
|
230 | - $temp4 = $ayn * $cosepw; |
|
231 | - $temp5 = $axn * $cosepw; |
|
232 | - $temp6 = $ayn * $sinepw; |
|
233 | - $epw = ($capu - $temp4 + $temp3 - $temp2) / (1.0 - $temp5 - $temp6) + $temp2; |
|
229 | + $temp3 = $axn*$sinepw; |
|
230 | + $temp4 = $ayn*$cosepw; |
|
231 | + $temp5 = $axn*$cosepw; |
|
232 | + $temp6 = $ayn*$sinepw; |
|
233 | + $epw = ($capu - $temp4 + $temp3 - $temp2)/(1.0 - $temp5 - $temp6) + $temp2; |
|
234 | 234 | if (abs($epw - $temp2) <= Predict::e6a) { |
235 | 235 | break; |
236 | 236 | } |
@@ -240,33 +240,33 @@ discard block |
||
240 | 240 | /* Short period preliminary quantities */ |
241 | 241 | $ecose = $temp5 + $temp6; |
242 | 242 | $esine = $temp3 - $temp4; |
243 | - $elsq = $axn * $axn + $ayn * $ayn; |
|
243 | + $elsq = $axn*$axn + $ayn*$ayn; |
|
244 | 244 | $temp = 1.0 - $elsq; |
245 | - $pl = $a * $temp; |
|
246 | - $r = $a * (1.0 - $ecose); |
|
247 | - $temp1 = 1.0 / $r; |
|
248 | - $rdot = Predict::xke * sqrt($a) * $esine * $temp1; |
|
249 | - $rfdot = Predict::xke * sqrt($pl) * $temp1; |
|
250 | - $temp2 = $a * $temp1; |
|
245 | + $pl = $a*$temp; |
|
246 | + $r = $a*(1.0 - $ecose); |
|
247 | + $temp1 = 1.0/$r; |
|
248 | + $rdot = Predict::xke*sqrt($a)*$esine*$temp1; |
|
249 | + $rfdot = Predict::xke*sqrt($pl)*$temp1; |
|
250 | + $temp2 = $a*$temp1; |
|
251 | 251 | $betal = sqrt($temp); |
252 | - $temp3 = 1.0 / (1.0 + $betal); |
|
253 | - $cosu = $temp2 * ($cosepw - $axn + $ayn * $esine * $temp3); |
|
254 | - $sinu = $temp2 * ($sinepw - $ayn - $axn * $esine * $temp3); |
|
252 | + $temp3 = 1.0/(1.0 + $betal); |
|
253 | + $cosu = $temp2*($cosepw - $axn + $ayn*$esine*$temp3); |
|
254 | + $sinu = $temp2*($sinepw - $ayn - $axn*$esine*$temp3); |
|
255 | 255 | $u = Predict_Math::AcTan($sinu, $cosu); |
256 | - $sin2u = 2.0 * $sinu * $cosu; |
|
257 | - $cos2u = 2.0 * $cosu * $cosu - 1.0; |
|
258 | - $temp = 1.0 / $pl; |
|
259 | - $temp1 = Predict::ck2 * $temp; |
|
260 | - $temp2 = $temp1 * $temp; |
|
256 | + $sin2u = 2.0*$sinu*$cosu; |
|
257 | + $cos2u = 2.0*$cosu*$cosu - 1.0; |
|
258 | + $temp = 1.0/$pl; |
|
259 | + $temp1 = Predict::ck2*$temp; |
|
260 | + $temp2 = $temp1*$temp; |
|
261 | 261 | |
262 | 262 | /* Update for short periodics */ |
263 | - $rk = $r * (1.0 - 1.5 * $temp2 * $betal * $sat->sgps->x3thm1) + |
|
264 | - 0.5 * $temp1 * $sat->sgps->x1mth2 * $cos2u; |
|
265 | - $uk = $u - 0.25 * $temp2 * $sat->sgps->x7thm1 * $sin2u; |
|
266 | - $xnodek = $xnode + 1.5 * $temp2 * $sat->sgps->cosio * $sin2u; |
|
267 | - $xinck = $sat->tle->xincl + 1.5 * $temp2 * $sat->sgps->cosio * $sat->sgps->sinio * $cos2u; |
|
268 | - $rdotk = $rdot - $xn * $temp1 * $sat->sgps->x1mth2 * $sin2u; |
|
269 | - $rfdotk = $rfdot + $xn * $temp1 * ($sat->sgps->x1mth2 * $cos2u + 1.5 * $sat->sgps->x3thm1); |
|
263 | + $rk = $r*(1.0 - 1.5*$temp2*$betal*$sat->sgps->x3thm1) + |
|
264 | + 0.5*$temp1*$sat->sgps->x1mth2*$cos2u; |
|
265 | + $uk = $u - 0.25*$temp2*$sat->sgps->x7thm1*$sin2u; |
|
266 | + $xnodek = $xnode + 1.5*$temp2*$sat->sgps->cosio*$sin2u; |
|
267 | + $xinck = $sat->tle->xincl + 1.5*$temp2*$sat->sgps->cosio*$sat->sgps->sinio*$cos2u; |
|
268 | + $rdotk = $rdot - $xn*$temp1*$sat->sgps->x1mth2*$sin2u; |
|
269 | + $rfdotk = $rfdot + $xn*$temp1*($sat->sgps->x1mth2*$cos2u + 1.5*$sat->sgps->x3thm1); |
|
270 | 270 | |
271 | 271 | |
272 | 272 | /* Orientation vectors */ |
@@ -276,22 +276,22 @@ discard block |
||
276 | 276 | $cosik = cos($xinck); |
277 | 277 | $sinnok = sin($xnodek); |
278 | 278 | $cosnok = cos($xnodek); |
279 | - $xmx = -$sinnok * $cosik; |
|
280 | - $xmy = $cosnok * $cosik; |
|
281 | - $ux = $xmx * $sinuk + $cosnok * $cosuk; |
|
282 | - $uy = $xmy * $sinuk + $sinnok * $cosuk; |
|
283 | - $uz = $sinik * $sinuk; |
|
284 | - $vx = $xmx * $cosuk - $cosnok * $sinuk; |
|
285 | - $vy = $xmy * $cosuk - $sinnok * $sinuk; |
|
286 | - $vz = $sinik * $cosuk; |
|
279 | + $xmx = -$sinnok*$cosik; |
|
280 | + $xmy = $cosnok*$cosik; |
|
281 | + $ux = $xmx*$sinuk + $cosnok*$cosuk; |
|
282 | + $uy = $xmy*$sinuk + $sinnok*$cosuk; |
|
283 | + $uz = $sinik*$sinuk; |
|
284 | + $vx = $xmx*$cosuk - $cosnok*$sinuk; |
|
285 | + $vy = $xmy*$cosuk - $sinnok*$sinuk; |
|
286 | + $vz = $sinik*$cosuk; |
|
287 | 287 | |
288 | 288 | /* Position and velocity */ |
289 | - $sat->pos->x = $rk * $ux; |
|
290 | - $sat->pos->y = $rk * $uy; |
|
291 | - $sat->pos->z = $rk * $uz; |
|
292 | - $sat->vel->x = $rdotk * $ux + $rfdotk * $vx; |
|
293 | - $sat->vel->y = $rdotk * $uy + $rfdotk * $vy; |
|
294 | - $sat->vel->z = $rdotk * $uz + $rfdotk * $vz; |
|
289 | + $sat->pos->x = $rk*$ux; |
|
290 | + $sat->pos->y = $rk*$uy; |
|
291 | + $sat->pos->z = $rk*$uz; |
|
292 | + $sat->vel->x = $rdotk*$ux + $rfdotk*$vx; |
|
293 | + $sat->vel->y = $rdotk*$uy + $rfdotk*$vy; |
|
294 | + $sat->vel->z = $rdotk*$uz + $rfdotk*$vz; |
|
295 | 295 | |
296 | 296 | $sat->phase = $xlt - $xnode - $omgadf + Predict::twopi; |
297 | 297 | if ($sat->phase < 0) { |
@@ -315,106 +315,106 @@ discard block |
||
315 | 315 | public function SDP4(Predict_Sat $sat, $tsince) |
316 | 316 | { |
317 | 317 | /* Initialization */ |
318 | - if (~$sat->flags & self::SDP4_INITIALIZED_FLAG) { |
|
318 | + if (~$sat->flags&self::SDP4_INITIALIZED_FLAG) { |
|
319 | 319 | |
320 | 320 | $sat->flags |= self::SDP4_INITIALIZED_FLAG; |
321 | 321 | |
322 | 322 | /* Recover original mean motion (xnodp) and */ |
323 | 323 | /* semimajor axis (aodp) from input elements. */ |
324 | - $a1 = pow(Predict::xke / $sat->tle->xno, Predict::tothrd); |
|
324 | + $a1 = pow(Predict::xke/$sat->tle->xno, Predict::tothrd); |
|
325 | 325 | $sat->deep_arg->cosio = cos($sat->tle->xincl); |
326 | - $sat->deep_arg->theta2 = $sat->deep_arg->cosio * $sat->deep_arg->cosio; |
|
327 | - $sat->sgps->x3thm1 = 3.0 * $sat->deep_arg->theta2 - 1.0; |
|
328 | - $sat->deep_arg->eosq = $sat->tle->eo * $sat->tle->eo; |
|
326 | + $sat->deep_arg->theta2 = $sat->deep_arg->cosio*$sat->deep_arg->cosio; |
|
327 | + $sat->sgps->x3thm1 = 3.0*$sat->deep_arg->theta2 - 1.0; |
|
328 | + $sat->deep_arg->eosq = $sat->tle->eo*$sat->tle->eo; |
|
329 | 329 | $sat->deep_arg->betao2 = 1.0 - $sat->deep_arg->eosq; |
330 | 330 | $sat->deep_arg->betao = sqrt($sat->deep_arg->betao2); |
331 | - $del1 = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / |
|
332 | - ($a1 * $a1 * $sat->deep_arg->betao * $sat->deep_arg->betao2); |
|
333 | - $ao = $a1 * (1.0 - $del1 * (0.5 * Predict::tothrd + $del1 * (1.0 + 134.0 / 81.0 * $del1))); |
|
334 | - $delo = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / |
|
335 | - ($ao * $ao * $sat->deep_arg->betao * $sat->deep_arg->betao2); |
|
336 | - $sat->deep_arg->xnodp = $sat->tle->xno / (1.0 + $delo); |
|
337 | - $sat->deep_arg->aodp = $ao / (1.0 - $delo); |
|
331 | + $del1 = 1.5*Predict::ck2*$sat->sgps->x3thm1/ |
|
332 | + ($a1*$a1*$sat->deep_arg->betao*$sat->deep_arg->betao2); |
|
333 | + $ao = $a1*(1.0 - $del1*(0.5*Predict::tothrd + $del1*(1.0 + 134.0/81.0*$del1))); |
|
334 | + $delo = 1.5*Predict::ck2*$sat->sgps->x3thm1/ |
|
335 | + ($ao*$ao*$sat->deep_arg->betao*$sat->deep_arg->betao2); |
|
336 | + $sat->deep_arg->xnodp = $sat->tle->xno/(1.0 + $delo); |
|
337 | + $sat->deep_arg->aodp = $ao/(1.0 - $delo); |
|
338 | 338 | |
339 | 339 | /* For perigee below 156 km, the values */ |
340 | 340 | /* of s and qoms2t are altered. */ |
341 | 341 | $s4 = Predict::__s__; |
342 | 342 | $qoms24 = Predict::qoms2t; |
343 | - $perige = ($sat->deep_arg->aodp * (1.0 - $sat->tle->eo) - Predict::ae) * Predict::xkmper; |
|
343 | + $perige = ($sat->deep_arg->aodp*(1.0 - $sat->tle->eo) - Predict::ae)*Predict::xkmper; |
|
344 | 344 | if ($perige < 156.0) { |
345 | 345 | if ($perige <= 98.0) { |
346 | 346 | $s4 = 20.0; |
347 | 347 | } else { |
348 | 348 | $s4 = $perige - 78.0; |
349 | 349 | } |
350 | - $qoms24 = pow((120.0 - $s4) * Predict::ae / Predict::xkmper, 4); |
|
351 | - $s4 = $s4 / Predict::xkmper + Predict::ae; |
|
350 | + $qoms24 = pow((120.0 - $s4)*Predict::ae/Predict::xkmper, 4); |
|
351 | + $s4 = $s4/Predict::xkmper + Predict::ae; |
|
352 | 352 | } |
353 | - $pinvsq = 1.0 / ($sat->deep_arg->aodp * $sat->deep_arg->aodp * |
|
354 | - $sat->deep_arg->betao2 * $sat->deep_arg->betao2); |
|
353 | + $pinvsq = 1.0/($sat->deep_arg->aodp*$sat->deep_arg->aodp* |
|
354 | + $sat->deep_arg->betao2*$sat->deep_arg->betao2); |
|
355 | 355 | $sat->deep_arg->sing = sin($sat->tle->omegao); |
356 | 356 | $sat->deep_arg->cosg = cos($sat->tle->omegao); |
357 | - $tsi = 1.0 / ($sat->deep_arg->aodp - $s4); |
|
358 | - $eta = $sat->deep_arg->aodp * $sat->tle->eo * $tsi; |
|
359 | - $etasq = $eta * $eta; |
|
360 | - $eeta = $sat->tle->eo * $eta; |
|
357 | + $tsi = 1.0/($sat->deep_arg->aodp - $s4); |
|
358 | + $eta = $sat->deep_arg->aodp*$sat->tle->eo*$tsi; |
|
359 | + $etasq = $eta*$eta; |
|
360 | + $eeta = $sat->tle->eo*$eta; |
|
361 | 361 | $psisq = abs(1.0 - $etasq); |
362 | - $coef = $qoms24 * pow($tsi, 4); |
|
363 | - $coef1 = $coef / pow($psisq, 3.5); |
|
364 | - $c2 = $coef1 * $sat->deep_arg->xnodp * ($sat->deep_arg->aodp * |
|
365 | - (1.0 + 1.5 * $etasq + $eeta * |
|
366 | - (4.0 + $etasq)) + 0.75 * Predict::ck2 * $tsi / $psisq * |
|
367 | - $sat->sgps->x3thm1 * (8.0 + 3.0 * $etasq * |
|
362 | + $coef = $qoms24*pow($tsi, 4); |
|
363 | + $coef1 = $coef/pow($psisq, 3.5); |
|
364 | + $c2 = $coef1*$sat->deep_arg->xnodp*($sat->deep_arg->aodp* |
|
365 | + (1.0 + 1.5*$etasq + $eeta* |
|
366 | + (4.0 + $etasq)) + 0.75*Predict::ck2*$tsi/$psisq* |
|
367 | + $sat->sgps->x3thm1*(8.0 + 3.0*$etasq* |
|
368 | 368 | (8.0 + $etasq))); |
369 | - $sat->sgps->c1 = $sat->tle->bstar * $c2; |
|
369 | + $sat->sgps->c1 = $sat->tle->bstar*$c2; |
|
370 | 370 | $sat->deep_arg->sinio = sin($sat->tle->xincl); |
371 | - $a3ovk2 = -Predict::xj3 / Predict::ck2 * pow(Predict::ae, 3); |
|
371 | + $a3ovk2 = -Predict::xj3/Predict::ck2*pow(Predict::ae, 3); |
|
372 | 372 | $sat->sgps->x1mth2 = 1.0 - $sat->deep_arg->theta2; |
373 | - $sat->sgps->c4 = 2.0 * $sat->deep_arg->xnodp * $coef1 * |
|
374 | - $sat->deep_arg->aodp * $sat->deep_arg->betao2 * |
|
375 | - ($eta * (2.0 + 0.5 * $etasq) + $sat->tle->eo * |
|
376 | - (0.5 + 2.0 * $etasq) - 2.0 * Predict::ck2 * $tsi / |
|
377 | - ($sat->deep_arg->aodp * $psisq) * (-3.0 * $sat->sgps->x3thm1 * |
|
378 | - (1.0 - 2.0 * $eeta + $etasq * |
|
379 | - (1.5 - 0.5 * $eeta)) + |
|
380 | - 0.75 * $sat->sgps->x1mth2 * |
|
381 | - (2.0 * $etasq - $eeta * (1.0 + $etasq)) * |
|
382 | - cos(2.0 * $sat->tle->omegao))); |
|
383 | - $theta4 = $sat->deep_arg->theta2 * $sat->deep_arg->theta2; |
|
384 | - $temp1 = 3.0 * Predict::ck2 * $pinvsq * $sat->deep_arg->xnodp; |
|
385 | - $temp2 = $temp1 * Predict::ck2 * $pinvsq; |
|
386 | - $temp3 = 1.25 * Predict::ck4 * $pinvsq * $pinvsq * $sat->deep_arg->xnodp; |
|
387 | - $sat->deep_arg->xmdot = $sat->deep_arg->xnodp + 0.5 * $temp1 * $sat->deep_arg->betao * |
|
388 | - $sat->sgps->x3thm1 + 0.0625 * $temp2 * $sat->deep_arg->betao * |
|
389 | - (13.0 - 78.0 * $sat->deep_arg->theta2 + 137.0 * $theta4); |
|
390 | - $x1m5th = 1.0 - 5.0 * $sat->deep_arg->theta2; |
|
391 | - $sat->deep_arg->omgdot = -0.5 * $temp1 * $x1m5th + 0.0625 * $temp2 * |
|
392 | - (7.0 - 114.0 * $sat->deep_arg->theta2 + 395.0 * $theta4) + |
|
393 | - $temp3 * (3.0 - 36.0 * $sat->deep_arg->theta2 + 49.0 * $theta4); |
|
394 | - $xhdot1 = -$temp1 * $sat->deep_arg->cosio; |
|
395 | - $sat->deep_arg->xnodot = $xhdot1 + (0.5 * $temp2 * (4.0 - 19.0 * $sat->deep_arg->theta2) + |
|
396 | - 2.0 * $temp3 * (3.0 - 7.0 * $sat->deep_arg->theta2)) * |
|
373 | + $sat->sgps->c4 = 2.0*$sat->deep_arg->xnodp*$coef1* |
|
374 | + $sat->deep_arg->aodp*$sat->deep_arg->betao2* |
|
375 | + ($eta*(2.0 + 0.5*$etasq) + $sat->tle->eo* |
|
376 | + (0.5 + 2.0*$etasq) - 2.0*Predict::ck2*$tsi/ |
|
377 | + ($sat->deep_arg->aodp*$psisq)*(-3.0*$sat->sgps->x3thm1* |
|
378 | + (1.0 - 2.0*$eeta + $etasq* |
|
379 | + (1.5 - 0.5*$eeta)) + |
|
380 | + 0.75*$sat->sgps->x1mth2* |
|
381 | + (2.0*$etasq - $eeta*(1.0 + $etasq))* |
|
382 | + cos(2.0*$sat->tle->omegao))); |
|
383 | + $theta4 = $sat->deep_arg->theta2*$sat->deep_arg->theta2; |
|
384 | + $temp1 = 3.0*Predict::ck2*$pinvsq*$sat->deep_arg->xnodp; |
|
385 | + $temp2 = $temp1*Predict::ck2*$pinvsq; |
|
386 | + $temp3 = 1.25*Predict::ck4*$pinvsq*$pinvsq*$sat->deep_arg->xnodp; |
|
387 | + $sat->deep_arg->xmdot = $sat->deep_arg->xnodp + 0.5*$temp1*$sat->deep_arg->betao* |
|
388 | + $sat->sgps->x3thm1 + 0.0625*$temp2*$sat->deep_arg->betao* |
|
389 | + (13.0 - 78.0*$sat->deep_arg->theta2 + 137.0*$theta4); |
|
390 | + $x1m5th = 1.0 - 5.0*$sat->deep_arg->theta2; |
|
391 | + $sat->deep_arg->omgdot = -0.5*$temp1*$x1m5th + 0.0625*$temp2* |
|
392 | + (7.0 - 114.0*$sat->deep_arg->theta2 + 395.0*$theta4) + |
|
393 | + $temp3*(3.0 - 36.0*$sat->deep_arg->theta2 + 49.0*$theta4); |
|
394 | + $xhdot1 = -$temp1*$sat->deep_arg->cosio; |
|
395 | + $sat->deep_arg->xnodot = $xhdot1 + (0.5*$temp2*(4.0 - 19.0*$sat->deep_arg->theta2) + |
|
396 | + 2.0*$temp3*(3.0 - 7.0*$sat->deep_arg->theta2))* |
|
397 | 397 | $sat->deep_arg->cosio; |
398 | - $sat->sgps->xnodcf = 3.5 * $sat->deep_arg->betao2 * $xhdot1 * $sat->sgps->c1; |
|
399 | - $sat->sgps->t2cof = 1.5 * $sat->sgps->c1; |
|
400 | - $sat->sgps->xlcof = 0.125 * $a3ovk2 * $sat->deep_arg->sinio * |
|
401 | - (3.0 + 5.0 * $sat->deep_arg->cosio) / (1.0 + $sat->deep_arg->cosio); |
|
402 | - $sat->sgps->aycof = 0.25 * $a3ovk2 * $sat->deep_arg->sinio; |
|
403 | - $sat->sgps->x7thm1 = 7.0 * $sat->deep_arg->theta2 - 1.0; |
|
398 | + $sat->sgps->xnodcf = 3.5*$sat->deep_arg->betao2*$xhdot1*$sat->sgps->c1; |
|
399 | + $sat->sgps->t2cof = 1.5*$sat->sgps->c1; |
|
400 | + $sat->sgps->xlcof = 0.125*$a3ovk2*$sat->deep_arg->sinio* |
|
401 | + (3.0 + 5.0*$sat->deep_arg->cosio)/(1.0 + $sat->deep_arg->cosio); |
|
402 | + $sat->sgps->aycof = 0.25*$a3ovk2*$sat->deep_arg->sinio; |
|
403 | + $sat->sgps->x7thm1 = 7.0*$sat->deep_arg->theta2 - 1.0; |
|
404 | 404 | |
405 | 405 | /* initialize Deep() */ |
406 | 406 | $this->Deep(self::dpinit, $sat); |
407 | 407 | }; /*End of SDP4() initialization */ |
408 | 408 | |
409 | 409 | /* Update for secular gravity and atmospheric drag */ |
410 | - $xmdf = $sat->tle->xmo + $sat->deep_arg->xmdot * $tsince; |
|
411 | - $sat->deep_arg->omgadf = $sat->tle->omegao + $sat->deep_arg->omgdot * $tsince; |
|
412 | - $xnoddf = $sat->tle->xnodeo + $sat->deep_arg->xnodot * $tsince; |
|
413 | - $tsq = $tsince * $tsince; |
|
414 | - $sat->deep_arg->xnode = $xnoddf + $sat->sgps->xnodcf * $tsq; |
|
415 | - $tempa = 1.0 - $sat->sgps->c1 * $tsince; |
|
416 | - $tempe = $sat->tle->bstar * $sat->sgps->c4 * $tsince; |
|
417 | - $templ = $sat->sgps->t2cof * $tsq; |
|
410 | + $xmdf = $sat->tle->xmo + $sat->deep_arg->xmdot*$tsince; |
|
411 | + $sat->deep_arg->omgadf = $sat->tle->omegao + $sat->deep_arg->omgdot*$tsince; |
|
412 | + $xnoddf = $sat->tle->xnodeo + $sat->deep_arg->xnodot*$tsince; |
|
413 | + $tsq = $tsince*$tsince; |
|
414 | + $sat->deep_arg->xnode = $xnoddf + $sat->sgps->xnodcf*$tsq; |
|
415 | + $tempa = 1.0 - $sat->sgps->c1*$tsince; |
|
416 | + $tempe = $sat->tle->bstar*$sat->sgps->c4*$tsince; |
|
417 | + $templ = $sat->sgps->t2cof*$tsq; |
|
418 | 418 | $sat->deep_arg->xn = $sat->deep_arg->xnodp; |
419 | 419 | |
420 | 420 | /* Update for deep-space secular effects */ |
@@ -424,9 +424,9 @@ discard block |
||
424 | 424 | $this->Deep(self::dpsec, $sat); |
425 | 425 | |
426 | 426 | $xmdf = $sat->deep_arg->xll; |
427 | - $a = pow(Predict::xke / $sat->deep_arg->xn, Predict::tothrd) * $tempa * $tempa; |
|
427 | + $a = pow(Predict::xke/$sat->deep_arg->xn, Predict::tothrd)*$tempa*$tempa; |
|
428 | 428 | $sat->deep_arg->em = $sat->deep_arg->em - $tempe; |
429 | - $xmam = $xmdf + $sat->deep_arg->xnodp * $templ; |
|
429 | + $xmam = $xmdf + $sat->deep_arg->xnodp*$templ; |
|
430 | 430 | |
431 | 431 | /* Update for deep-space periodic effects */ |
432 | 432 | $sat->deep_arg->xll = $xmam; |
@@ -435,30 +435,30 @@ discard block |
||
435 | 435 | |
436 | 436 | $xmam = $sat->deep_arg->xll; |
437 | 437 | $xl = $xmam + $sat->deep_arg->omgadf + $sat->deep_arg->xnode; |
438 | - $beta = sqrt(1.0 - $sat->deep_arg->em * $sat->deep_arg->em); |
|
439 | - $sat->deep_arg->xn = Predict::xke / pow($a, 1.5); |
|
438 | + $beta = sqrt(1.0 - $sat->deep_arg->em*$sat->deep_arg->em); |
|
439 | + $sat->deep_arg->xn = Predict::xke/pow($a, 1.5); |
|
440 | 440 | |
441 | 441 | /* Long period periodics */ |
442 | - $axn = $sat->deep_arg->em * cos($sat->deep_arg->omgadf); |
|
443 | - $temp = 1.0 / ($a * $beta * $beta); |
|
444 | - $xll = $temp * $sat->sgps->xlcof * $axn; |
|
445 | - $aynl = $temp * $sat->sgps->aycof; |
|
442 | + $axn = $sat->deep_arg->em*cos($sat->deep_arg->omgadf); |
|
443 | + $temp = 1.0/($a*$beta*$beta); |
|
444 | + $xll = $temp*$sat->sgps->xlcof*$axn; |
|
445 | + $aynl = $temp*$sat->sgps->aycof; |
|
446 | 446 | $xlt = $xl + $xll; |
447 | - $ayn = $sat->deep_arg->em * sin($sat->deep_arg->omgadf) + $aynl; |
|
447 | + $ayn = $sat->deep_arg->em*sin($sat->deep_arg->omgadf) + $aynl; |
|
448 | 448 | |
449 | 449 | /* Solve Kepler's Equation */ |
450 | - $capu = Predict_Math::FMod2p ($xlt - $sat->deep_arg->xnode); |
|
450 | + $capu = Predict_Math::FMod2p($xlt - $sat->deep_arg->xnode); |
|
451 | 451 | $temp2 = $capu; |
452 | 452 | |
453 | 453 | $i = 0; |
454 | 454 | do { |
455 | 455 | $sinepw = sin($temp2); |
456 | 456 | $cosepw = cos($temp2); |
457 | - $temp3 = $axn * $sinepw; |
|
458 | - $temp4 = $ayn * $cosepw; |
|
459 | - $temp5 = $axn * $cosepw; |
|
460 | - $temp6 = $ayn * $sinepw; |
|
461 | - $epw = ($capu - $temp4 + $temp3 - $temp2) / (1.0 - $temp5 - $temp6) + $temp2; |
|
457 | + $temp3 = $axn*$sinepw; |
|
458 | + $temp4 = $ayn*$cosepw; |
|
459 | + $temp5 = $axn*$cosepw; |
|
460 | + $temp6 = $ayn*$sinepw; |
|
461 | + $epw = ($capu - $temp4 + $temp3 - $temp2)/(1.0 - $temp5 - $temp6) + $temp2; |
|
462 | 462 | if (abs($epw - $temp2) <= Predict::e6a) { |
463 | 463 | break; |
464 | 464 | } |
@@ -468,35 +468,35 @@ discard block |
||
468 | 468 | /* Short period preliminary quantities */ |
469 | 469 | $ecose = $temp5 + $temp6; |
470 | 470 | $esine = $temp3 - $temp4; |
471 | - $elsq = $axn * $axn + $ayn * $ayn; |
|
471 | + $elsq = $axn*$axn + $ayn*$ayn; |
|
472 | 472 | $temp = 1.0 - $elsq; |
473 | - $pl = $a * $temp; |
|
474 | - $r = $a * (1.0 - $ecose); |
|
475 | - $temp1 = 1.0 / $r; |
|
476 | - $rdot = Predict::xke * sqrt($a) * $esine * $temp1; |
|
477 | - $rfdot = Predict::xke * sqrt($pl) * $temp1; |
|
478 | - $temp2 = $a * $temp1; |
|
473 | + $pl = $a*$temp; |
|
474 | + $r = $a*(1.0 - $ecose); |
|
475 | + $temp1 = 1.0/$r; |
|
476 | + $rdot = Predict::xke*sqrt($a)*$esine*$temp1; |
|
477 | + $rfdot = Predict::xke*sqrt($pl)*$temp1; |
|
478 | + $temp2 = $a*$temp1; |
|
479 | 479 | $betal = sqrt($temp); |
480 | - $temp3 = 1.0 / (1.0 + $betal); |
|
481 | - $cosu = $temp2 * ($cosepw - $axn + $ayn * $esine * $temp3); |
|
482 | - $sinu = $temp2 * ($sinepw - $ayn - $axn * $esine * $temp3); |
|
480 | + $temp3 = 1.0/(1.0 + $betal); |
|
481 | + $cosu = $temp2*($cosepw - $axn + $ayn*$esine*$temp3); |
|
482 | + $sinu = $temp2*($sinepw - $ayn - $axn*$esine*$temp3); |
|
483 | 483 | $u = Predict_Math::AcTan($sinu, $cosu); |
484 | - $sin2u = 2.0 * $sinu * $cosu; |
|
485 | - $cos2u = 2.0 * $cosu * $cosu - 1.0; |
|
486 | - $temp = 1.0 / $pl; |
|
487 | - $temp1 = Predict::ck2 * $temp; |
|
488 | - $temp2 = $temp1 * $temp; |
|
484 | + $sin2u = 2.0*$sinu*$cosu; |
|
485 | + $cos2u = 2.0*$cosu*$cosu - 1.0; |
|
486 | + $temp = 1.0/$pl; |
|
487 | + $temp1 = Predict::ck2*$temp; |
|
488 | + $temp2 = $temp1*$temp; |
|
489 | 489 | |
490 | 490 | /* Update for short periodics */ |
491 | - $rk = $r * (1.0 - 1.5 * $temp2 * $betal * $sat->sgps->x3thm1) + |
|
492 | - 0.5 * $temp1 * $sat->sgps->x1mth2 * $cos2u; |
|
493 | - $uk = $u - 0.25 * $temp2 * $sat->sgps->x7thm1 * $sin2u; |
|
494 | - $xnodek = $sat->deep_arg->xnode + 1.5 * $temp2 * $sat->deep_arg->cosio * $sin2u; |
|
495 | - $xinck = $sat->deep_arg->xinc + 1.5 * $temp2 * |
|
496 | - $sat->deep_arg->cosio * $sat->deep_arg->sinio * $cos2u; |
|
497 | - $rdotk = $rdot - $sat->deep_arg->xn * $temp1 * $sat->sgps->x1mth2 * $sin2u; |
|
498 | - $rfdotk = $rfdot + $sat->deep_arg->xn * $temp1 * |
|
499 | - ($sat->sgps->x1mth2 * $cos2u + 1.5 * $sat->sgps->x3thm1); |
|
491 | + $rk = $r*(1.0 - 1.5*$temp2*$betal*$sat->sgps->x3thm1) + |
|
492 | + 0.5*$temp1*$sat->sgps->x1mth2*$cos2u; |
|
493 | + $uk = $u - 0.25*$temp2*$sat->sgps->x7thm1*$sin2u; |
|
494 | + $xnodek = $sat->deep_arg->xnode + 1.5*$temp2*$sat->deep_arg->cosio*$sin2u; |
|
495 | + $xinck = $sat->deep_arg->xinc + 1.5*$temp2* |
|
496 | + $sat->deep_arg->cosio*$sat->deep_arg->sinio*$cos2u; |
|
497 | + $rdotk = $rdot - $sat->deep_arg->xn*$temp1*$sat->sgps->x1mth2*$sin2u; |
|
498 | + $rfdotk = $rfdot + $sat->deep_arg->xn*$temp1* |
|
499 | + ($sat->sgps->x1mth2*$cos2u + 1.5*$sat->sgps->x3thm1); |
|
500 | 500 | |
501 | 501 | /* Orientation vectors */ |
502 | 502 | $sinuk = sin($uk); |
@@ -505,29 +505,29 @@ discard block |
||
505 | 505 | $cosik = cos($xinck); |
506 | 506 | $sinnok = sin($xnodek); |
507 | 507 | $cosnok = cos($xnodek); |
508 | - $xmx = -$sinnok * $cosik; |
|
509 | - $xmy = $cosnok * $cosik; |
|
510 | - $ux = $xmx * $sinuk + $cosnok * $cosuk; |
|
511 | - $uy = $xmy * $sinuk + $sinnok * $cosuk; |
|
512 | - $uz = $sinik * $sinuk; |
|
513 | - $vx = $xmx * $cosuk - $cosnok * $sinuk; |
|
514 | - $vy = $xmy * $cosuk - $sinnok * $sinuk; |
|
515 | - $vz = $sinik * $cosuk; |
|
508 | + $xmx = -$sinnok*$cosik; |
|
509 | + $xmy = $cosnok*$cosik; |
|
510 | + $ux = $xmx*$sinuk + $cosnok*$cosuk; |
|
511 | + $uy = $xmy*$sinuk + $sinnok*$cosuk; |
|
512 | + $uz = $sinik*$sinuk; |
|
513 | + $vx = $xmx*$cosuk - $cosnok*$sinuk; |
|
514 | + $vy = $xmy*$cosuk - $sinnok*$sinuk; |
|
515 | + $vz = $sinik*$cosuk; |
|
516 | 516 | |
517 | 517 | /* Position and velocity */ |
518 | - $sat->pos->x = $rk * $ux; |
|
519 | - $sat->pos->y = $rk * $uy; |
|
520 | - $sat->pos->z = $rk * $uz; |
|
521 | - $sat->vel->x = $rdotk * $ux + $rfdotk * $vx; |
|
522 | - $sat->vel->y = $rdotk * $uy + $rfdotk * $vy; |
|
523 | - $sat->vel->z = $rdotk * $uz + $rfdotk * $vz; |
|
518 | + $sat->pos->x = $rk*$ux; |
|
519 | + $sat->pos->y = $rk*$uy; |
|
520 | + $sat->pos->z = $rk*$uz; |
|
521 | + $sat->vel->x = $rdotk*$ux + $rfdotk*$vx; |
|
522 | + $sat->vel->y = $rdotk*$uy + $rfdotk*$vy; |
|
523 | + $sat->vel->z = $rdotk*$uz + $rfdotk*$vz; |
|
524 | 524 | |
525 | 525 | /* Phase in rads */ |
526 | 526 | $sat->phase = $xlt - $sat->deep_arg->xnode - $sat->deep_arg->omgadf + Predict::twopi; |
527 | 527 | if ($sat->phase < 0.0) { |
528 | 528 | $sat->phase += Predict::twopi; |
529 | 529 | } |
530 | - $sat->phase = Predict_Math::FMod2p ($sat->phase); |
|
530 | + $sat->phase = Predict_Math::FMod2p($sat->phase); |
|
531 | 531 | |
532 | 532 | $sat->tle->omegao1 = $sat->deep_arg->omgadf; |
533 | 533 | $sat->tle->xincl1 = $sat->deep_arg->xinc; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $sat->dps->thgr = Predict_Time::ThetaG($sat->tle->epoch, $sat->deep_arg); |
546 | 546 | $eq = $sat->tle->eo; |
547 | 547 | $sat->dps->xnq = $sat->deep_arg->xnodp; |
548 | - $aqnv = 1.0 / $sat->deep_arg->aodp; |
|
548 | + $aqnv = 1.0/$sat->deep_arg->aodp; |
|
549 | 549 | $sat->dps->xqncl = $sat->tle->xincl; |
550 | 550 | $xmao = $sat->tle->xmo; |
551 | 551 | $xpidot = $sat->deep_arg->omgdot + $sat->deep_arg->xnodot; |
@@ -555,26 +555,26 @@ discard block |
||
555 | 555 | $sat->dps->preep = 0; |
556 | 556 | |
557 | 557 | /* Initialize lunar solar terms */ |
558 | - $day = $sat->deep_arg->ds50 + 18261.5; /* Days since 1900 Jan 0.5 */ |
|
558 | + $day = $sat->deep_arg->ds50 + 18261.5; /* Days since 1900 Jan 0.5 */ |
|
559 | 559 | if ($day != $sat->dps->preep) { |
560 | 560 | $sat->dps->preep = $day; |
561 | - $xnodce = 4.5236020 - 9.2422029E-4 * $day; |
|
561 | + $xnodce = 4.5236020 - 9.2422029E-4*$day; |
|
562 | 562 | $stem = sin($xnodce); |
563 | 563 | $ctem = cos($xnodce); |
564 | - $sat->dps->zcosil = 0.91375164 - 0.03568096 * $ctem; |
|
565 | - $sat->dps->zsinil = sqrt(1.0 - $sat->dps->zcosil * $sat->dps->zcosil); |
|
566 | - $sat->dps->zsinhl = 0.089683511 * $stem / $sat->dps->zsinil; |
|
567 | - $sat->dps->zcoshl = sqrt(1.0 - $sat->dps->zsinhl * $sat->dps->zsinhl); |
|
568 | - $c = 4.7199672 + 0.22997150 * $day; |
|
569 | - $gam = 5.8351514 + 0.0019443680 * $day; |
|
564 | + $sat->dps->zcosil = 0.91375164 - 0.03568096*$ctem; |
|
565 | + $sat->dps->zsinil = sqrt(1.0 - $sat->dps->zcosil*$sat->dps->zcosil); |
|
566 | + $sat->dps->zsinhl = 0.089683511*$stem/$sat->dps->zsinil; |
|
567 | + $sat->dps->zcoshl = sqrt(1.0 - $sat->dps->zsinhl*$sat->dps->zsinhl); |
|
568 | + $c = 4.7199672 + 0.22997150*$day; |
|
569 | + $gam = 5.8351514 + 0.0019443680*$day; |
|
570 | 570 | $sat->dps->zmol = Predict_Math::FMod2p($c - $gam); |
571 | - $zx = 0.39785416 * $stem / $sat->dps->zsinil; |
|
572 | - $zy = $sat->dps->zcoshl * $ctem + 0.91744867 * $sat->dps->zsinhl * $stem; |
|
571 | + $zx = 0.39785416*$stem/$sat->dps->zsinil; |
|
572 | + $zy = $sat->dps->zcoshl*$ctem + 0.91744867*$sat->dps->zsinhl*$stem; |
|
573 | 573 | $zx = Predict_Math::AcTan($zx, $zy); |
574 | 574 | $zx = $gam + $zx - $xnodce; |
575 | 575 | $sat->dps->zcosgl = cos($zx); |
576 | 576 | $sat->dps->zsingl = sin($zx); |
577 | - $sat->dps->zmos = 6.2565837 + 0.017201977 * $day; |
|
577 | + $sat->dps->zmos = 6.2565837 + 0.017201977*$day; |
|
578 | 578 | $sat->dps->zmos = Predict_Math::FMod2p($sat->dps->zmos); |
579 | 579 | } /* End if(day != preep) */ |
580 | 580 | |
@@ -590,76 +590,76 @@ discard block |
||
590 | 590 | $zn = Predict::zns; |
591 | 591 | $ze = Predict::zes; |
592 | 592 | $zmo = $sat->dps->zmos; |
593 | - $xnoi = 1.0 / $sat->dps->xnq; |
|
593 | + $xnoi = 1.0/$sat->dps->xnq; |
|
594 | 594 | |
595 | 595 | /* Loop breaks when Solar terms are done a second */ |
596 | 596 | /* time, after Lunar terms are initialized */ |
597 | - for(;;) { |
|
597 | + for (;;) { |
|
598 | 598 | /* Solar terms done again after Lunar terms are done */ |
599 | - $a1 = $zcosg * $zcosh + $zsing * $zcosi * $zsinh; |
|
600 | - $a3 = -$zsing * $zcosh + $zcosg * $zcosi * $zsinh; |
|
601 | - $a7 = -$zcosg * $zsinh + $zsing * $zcosi * $zcosh; |
|
602 | - $a8 = $zsing * $zsini; |
|
603 | - $a9 = $zsing * $zsinh + $zcosg * $zcosi * $zcosh; |
|
604 | - $a10 = $zcosg * $zsini; |
|
605 | - $a2 = $sat->deep_arg->cosio * $a7 + $sat->deep_arg->sinio * $a8; |
|
606 | - $a4 = $sat->deep_arg->cosio * $a9 + $sat->deep_arg->sinio * $a10; |
|
607 | - $a5 = -$sat->deep_arg->sinio * $a7 + $sat->deep_arg->cosio * $a8; |
|
608 | - $a6 = -$sat->deep_arg->sinio * $a9 + $sat->deep_arg->cosio * $a10; |
|
609 | - $x1 = $a1 * $sat->deep_arg->cosg + $a2 * $sat->deep_arg->sing; |
|
610 | - $x2 = $a3 * $sat->deep_arg->cosg + $a4 * $sat->deep_arg->sing; |
|
611 | - $x3 = -$a1 * $sat->deep_arg->sing + $a2 * $sat->deep_arg->cosg; |
|
612 | - $x4 = -$a3 * $sat->deep_arg->sing + $a4 * $sat->deep_arg->cosg; |
|
613 | - $x5 = $a5 * $sat->deep_arg->sing; |
|
614 | - $x6 = $a6 * $sat->deep_arg->sing; |
|
615 | - $x7 = $a5 * $sat->deep_arg->cosg; |
|
616 | - $x8 = $a6 * $sat->deep_arg->cosg; |
|
617 | - $z31 = 12 * $x1 * $x1 - 3 * $x3 * $x3; |
|
618 | - $z32 = 24 * $x1 * $x2 - 6 * $x3 * $x4; |
|
619 | - $z33 = 12 * $x2 * $x2 - 3 * $x4 * $x4; |
|
620 | - $z1 = 3 * ($a1 * $a1 + $a2 * $a2) + $z31 * $sat->deep_arg->eosq; |
|
621 | - $z2 = 6 * ($a1 * $a3 + $a2 * $a4) + $z32 * $sat->deep_arg->eosq; |
|
622 | - $z3 = 3 * ($a3 * $a3 + $a4 * $a4) + $z33 * $sat->deep_arg->eosq; |
|
623 | - $z11 = -6 * $a1 * $a5 + $sat->deep_arg->eosq * (-24 * $x1 * $x7 - 6 * $x3 * $x5); |
|
624 | - $z12 = -6 * ($a1 * $a6 + $a3 * $a5) + $sat->deep_arg->eosq * |
|
625 | - (-24 * ($x2 * $x7 + $x1 * $x8) - 6 * ($x3 * $x6 + $x4 * $x5)); |
|
626 | - $z13 = -6 * $a3 * $a6 + $sat->deep_arg->eosq * (-24 * $x2 * $x8 - 6 * $x4 * $x6); |
|
627 | - $z21 = 6 * $a2 * $a5 + $sat->deep_arg->eosq * (24 * $x1 * $x5 - 6 * $x3 * $x7); |
|
628 | - $z22 = 6 * ($a4 * $a5 + $a2 * $a6) + $sat->deep_arg->eosq * |
|
629 | - (24 * ($x2 * $x5 + $x1 * $x6) - 6 * ($x4 * $x7 + $x3 * $x8)); |
|
630 | - $z23 = 6 * $a4 * $a6 + $sat->deep_arg->eosq * (24 * $x2 * $x6 - 6 * $x4 * $x8); |
|
631 | - $z1 = $z1 + $z1 + $sat->deep_arg->betao2 * $z31; |
|
632 | - $z2 = $z2 + $z2 + $sat->deep_arg->betao2 * $z32; |
|
633 | - $z3 = $z3 + $z3 + $sat->deep_arg->betao2 * $z33; |
|
634 | - $s3 = $cc * $xnoi; |
|
635 | - $s2 = -0.5 * $s3 / $sat->deep_arg->betao; |
|
636 | - $s4 = $s3 * $sat->deep_arg->betao; |
|
637 | - $s1 = -15 * $eq * $s4; |
|
638 | - $s5 = $x1 * $x3 + $x2 * $x4; |
|
639 | - $s6 = $x2 * $x3 + $x1 * $x4; |
|
640 | - $s7 = $x2 * $x4 - $x1 * $x3; |
|
641 | - $se = $s1 * $zn * $s5; |
|
642 | - $si = $s2 * $zn * ($z11 + $z13); |
|
643 | - $sl = -$zn * $s3 * ($z1 + $z3 - 14 - 6 * $sat->deep_arg->eosq); |
|
644 | - $sgh = $s4 * $zn * ($z31 + $z33 - 6); |
|
645 | - $sh = -$zn * $s2 * ($z21 + $z23); |
|
599 | + $a1 = $zcosg*$zcosh + $zsing*$zcosi*$zsinh; |
|
600 | + $a3 = -$zsing*$zcosh + $zcosg*$zcosi*$zsinh; |
|
601 | + $a7 = -$zcosg*$zsinh + $zsing*$zcosi*$zcosh; |
|
602 | + $a8 = $zsing*$zsini; |
|
603 | + $a9 = $zsing*$zsinh + $zcosg*$zcosi*$zcosh; |
|
604 | + $a10 = $zcosg*$zsini; |
|
605 | + $a2 = $sat->deep_arg->cosio*$a7 + $sat->deep_arg->sinio*$a8; |
|
606 | + $a4 = $sat->deep_arg->cosio*$a9 + $sat->deep_arg->sinio*$a10; |
|
607 | + $a5 = -$sat->deep_arg->sinio*$a7 + $sat->deep_arg->cosio*$a8; |
|
608 | + $a6 = -$sat->deep_arg->sinio*$a9 + $sat->deep_arg->cosio*$a10; |
|
609 | + $x1 = $a1*$sat->deep_arg->cosg + $a2*$sat->deep_arg->sing; |
|
610 | + $x2 = $a3*$sat->deep_arg->cosg + $a4*$sat->deep_arg->sing; |
|
611 | + $x3 = -$a1*$sat->deep_arg->sing + $a2*$sat->deep_arg->cosg; |
|
612 | + $x4 = -$a3*$sat->deep_arg->sing + $a4*$sat->deep_arg->cosg; |
|
613 | + $x5 = $a5*$sat->deep_arg->sing; |
|
614 | + $x6 = $a6*$sat->deep_arg->sing; |
|
615 | + $x7 = $a5*$sat->deep_arg->cosg; |
|
616 | + $x8 = $a6*$sat->deep_arg->cosg; |
|
617 | + $z31 = 12*$x1*$x1 - 3*$x3*$x3; |
|
618 | + $z32 = 24*$x1*$x2 - 6*$x3*$x4; |
|
619 | + $z33 = 12*$x2*$x2 - 3*$x4*$x4; |
|
620 | + $z1 = 3*($a1*$a1 + $a2*$a2) + $z31*$sat->deep_arg->eosq; |
|
621 | + $z2 = 6*($a1*$a3 + $a2*$a4) + $z32*$sat->deep_arg->eosq; |
|
622 | + $z3 = 3*($a3*$a3 + $a4*$a4) + $z33*$sat->deep_arg->eosq; |
|
623 | + $z11 = -6*$a1*$a5 + $sat->deep_arg->eosq*(-24*$x1*$x7 - 6*$x3*$x5); |
|
624 | + $z12 = -6*($a1*$a6 + $a3*$a5) + $sat->deep_arg->eosq* |
|
625 | + (-24*($x2*$x7 + $x1*$x8) - 6*($x3*$x6 + $x4*$x5)); |
|
626 | + $z13 = -6*$a3*$a6 + $sat->deep_arg->eosq*(-24*$x2*$x8 - 6*$x4*$x6); |
|
627 | + $z21 = 6*$a2*$a5 + $sat->deep_arg->eosq*(24*$x1*$x5 - 6*$x3*$x7); |
|
628 | + $z22 = 6*($a4*$a5 + $a2*$a6) + $sat->deep_arg->eosq* |
|
629 | + (24*($x2*$x5 + $x1*$x6) - 6*($x4*$x7 + $x3*$x8)); |
|
630 | + $z23 = 6*$a4*$a6 + $sat->deep_arg->eosq*(24*$x2*$x6 - 6*$x4*$x8); |
|
631 | + $z1 = $z1 + $z1 + $sat->deep_arg->betao2*$z31; |
|
632 | + $z2 = $z2 + $z2 + $sat->deep_arg->betao2*$z32; |
|
633 | + $z3 = $z3 + $z3 + $sat->deep_arg->betao2*$z33; |
|
634 | + $s3 = $cc*$xnoi; |
|
635 | + $s2 = -0.5*$s3/$sat->deep_arg->betao; |
|
636 | + $s4 = $s3*$sat->deep_arg->betao; |
|
637 | + $s1 = -15*$eq*$s4; |
|
638 | + $s5 = $x1*$x3 + $x2*$x4; |
|
639 | + $s6 = $x2*$x3 + $x1*$x4; |
|
640 | + $s7 = $x2*$x4 - $x1*$x3; |
|
641 | + $se = $s1*$zn*$s5; |
|
642 | + $si = $s2*$zn*($z11 + $z13); |
|
643 | + $sl = -$zn*$s3*($z1 + $z3 - 14 - 6*$sat->deep_arg->eosq); |
|
644 | + $sgh = $s4*$zn*($z31 + $z33 - 6); |
|
645 | + $sh = -$zn*$s2*($z21 + $z23); |
|
646 | 646 | if ($sat->dps->xqncl < 5.2359877E-2) { |
647 | 647 | $sh = 0; |
648 | 648 | } |
649 | - $sat->dps->ee2 = 2 * $s1 * $s6; |
|
650 | - $sat->dps->e3 = 2 * $s1 * $s7; |
|
651 | - $sat->dps->xi2 = 2 * $s2 * $z12; |
|
652 | - $sat->dps->xi3 = 2 * $s2 * ($z13 - $z11); |
|
653 | - $sat->dps->xl2 = -2 * $s3 * $z2; |
|
654 | - $sat->dps->xl3 = -2 * $s3 * ($z3 - $z1); |
|
655 | - $sat->dps->xl4 = -2 * $s3 * (-21 - 9 * $sat->deep_arg->eosq) * $ze; |
|
656 | - $sat->dps->xgh2 = 2 * $s4 * $z32; |
|
657 | - $sat->dps->xgh3 = 2 * $s4 * ($z33 - $z31); |
|
658 | - $sat->dps->xgh4 = -18 * $s4 * $ze; |
|
659 | - $sat->dps->xh2 = -2 * $s2 * $z22; |
|
660 | - $sat->dps->xh3 = -2 * $s2 * ($z23 - $z21); |
|
661 | - |
|
662 | - if ($sat->flags & self::LUNAR_TERMS_DONE_FLAG) { |
|
649 | + $sat->dps->ee2 = 2*$s1*$s6; |
|
650 | + $sat->dps->e3 = 2*$s1*$s7; |
|
651 | + $sat->dps->xi2 = 2*$s2*$z12; |
|
652 | + $sat->dps->xi3 = 2*$s2*($z13 - $z11); |
|
653 | + $sat->dps->xl2 = -2*$s3*$z2; |
|
654 | + $sat->dps->xl3 = -2*$s3*($z3 - $z1); |
|
655 | + $sat->dps->xl4 = -2*$s3*(-21 - 9*$sat->deep_arg->eosq)*$ze; |
|
656 | + $sat->dps->xgh2 = 2*$s4*$z32; |
|
657 | + $sat->dps->xgh3 = 2*$s4*($z33 - $z31); |
|
658 | + $sat->dps->xgh4 = -18*$s4*$ze; |
|
659 | + $sat->dps->xh2 = -2*$s2*$z22; |
|
660 | + $sat->dps->xh3 = -2*$s2*($z23 - $z21); |
|
661 | + |
|
662 | + if ($sat->flags&self::LUNAR_TERMS_DONE_FLAG) { |
|
663 | 663 | break; |
664 | 664 | } |
665 | 665 | |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | $sat->dps->sse = $se; |
668 | 668 | $sat->dps->ssi = $si; |
669 | 669 | $sat->dps->ssl = $sl; |
670 | - $sat->dps->ssh = $sh / $sat->deep_arg->sinio; |
|
671 | - $sat->dps->ssg = $sgh - $sat->deep_arg->cosio * $sat->dps->ssh; |
|
670 | + $sat->dps->ssh = $sh/$sat->deep_arg->sinio; |
|
671 | + $sat->dps->ssg = $sgh - $sat->deep_arg->cosio*$sat->dps->ssh; |
|
672 | 672 | $sat->dps->se2 = $sat->dps->ee2; |
673 | 673 | $sat->dps->si2 = $sat->dps->xi2; |
674 | 674 | $sat->dps->sl2 = $sat->dps->xl2; |
@@ -685,8 +685,8 @@ discard block |
||
685 | 685 | $zsing = $sat->dps->zsingl; |
686 | 686 | $zcosi = $sat->dps->zcosil; |
687 | 687 | $zsini = $sat->dps->zsinil; |
688 | - $zcosh = $sat->dps->zcoshl * $cosq + $sat->dps->zsinhl * $sinq; |
|
689 | - $zsinh = $sinq * $sat->dps->zcoshl - $cosq * $sat->dps->zsinhl; |
|
688 | + $zcosh = $sat->dps->zcoshl*$cosq + $sat->dps->zsinhl*$sinq; |
|
689 | + $zsinh = $sinq*$sat->dps->zcoshl - $cosq*$sat->dps->zsinhl; |
|
690 | 690 | $zn = Predict::znl; |
691 | 691 | $cc = Predict::c1l; |
692 | 692 | $ze = Predict::zel; |
@@ -697,113 +697,113 @@ discard block |
||
697 | 697 | $sat->dps->sse = $sat->dps->sse + $se; |
698 | 698 | $sat->dps->ssi = $sat->dps->ssi + $si; |
699 | 699 | $sat->dps->ssl = $sat->dps->ssl + $sl; |
700 | - $sat->dps->ssg = $sat->dps->ssg + $sgh - $sat->deep_arg->cosio / $sat->deep_arg->sinio * $sh; |
|
701 | - $sat->dps->ssh = $sat->dps->ssh + $sh / $sat->deep_arg->sinio; |
|
700 | + $sat->dps->ssg = $sat->dps->ssg + $sgh - $sat->deep_arg->cosio/$sat->deep_arg->sinio*$sh; |
|
701 | + $sat->dps->ssh = $sat->dps->ssh + $sh/$sat->deep_arg->sinio; |
|
702 | 702 | |
703 | 703 | /* Geopotential resonance initialization for 12 hour orbits */ |
704 | 704 | $sat->flags &= ~self::RESONANCE_FLAG; |
705 | 705 | $sat->flags &= ~self::SYNCHRONOUS_FLAG; |
706 | 706 | |
707 | 707 | if (!(($sat->dps->xnq < 0.0052359877) && ($sat->dps->xnq > 0.0034906585))) { |
708 | - if( ($sat->dps->xnq < 0.00826) || ($sat->dps->xnq > 0.00924) ) { |
|
708 | + if (($sat->dps->xnq < 0.00826) || ($sat->dps->xnq > 0.00924)) { |
|
709 | 709 | return; |
710 | 710 | } |
711 | 711 | if ($eq < 0.5) { |
712 | 712 | return; |
713 | 713 | } |
714 | 714 | $sat->flags |= self::RESONANCE_FLAG; |
715 | - $eoc = $eq * $sat->deep_arg->eosq; |
|
716 | - $g201 = -0.306 - ($eq - 0.64) * 0.440; |
|
715 | + $eoc = $eq*$sat->deep_arg->eosq; |
|
716 | + $g201 = -0.306 - ($eq - 0.64)*0.440; |
|
717 | 717 | if ($eq <= 0.65) { |
718 | - $g211 = 3.616 - 13.247 * $eq + 16.290 * $sat->deep_arg->eosq; |
|
719 | - $g310 = -19.302 + 117.390 * $eq - 228.419 * |
|
720 | - $sat->deep_arg->eosq + 156.591 * $eoc; |
|
721 | - $g322 = -18.9068 + 109.7927 * $eq - 214.6334 * |
|
722 | - $sat->deep_arg->eosq + 146.5816 * $eoc; |
|
723 | - $g410 = -41.122 + 242.694 * $eq - 471.094 * |
|
724 | - $sat->deep_arg->eosq + 313.953 * $eoc; |
|
725 | - $g422 = -146.407 + 841.880 * $eq - 1629.014 * |
|
726 | - $sat->deep_arg->eosq + 1083.435 * $eoc; |
|
727 | - $g520 = -532.114 + 3017.977 * $eq - 5740 * |
|
728 | - $sat->deep_arg->eosq + 3708.276 * $eoc; |
|
718 | + $g211 = 3.616 - 13.247*$eq + 16.290*$sat->deep_arg->eosq; |
|
719 | + $g310 = -19.302 + 117.390*$eq - 228.419* |
|
720 | + $sat->deep_arg->eosq + 156.591*$eoc; |
|
721 | + $g322 = -18.9068 + 109.7927*$eq - 214.6334* |
|
722 | + $sat->deep_arg->eosq + 146.5816*$eoc; |
|
723 | + $g410 = -41.122 + 242.694*$eq - 471.094* |
|
724 | + $sat->deep_arg->eosq + 313.953*$eoc; |
|
725 | + $g422 = -146.407 + 841.880*$eq - 1629.014* |
|
726 | + $sat->deep_arg->eosq + 1083.435*$eoc; |
|
727 | + $g520 = -532.114 + 3017.977*$eq - 5740* |
|
728 | + $sat->deep_arg->eosq + 3708.276*$eoc; |
|
729 | 729 | } else { |
730 | - $g211 = -72.099 + 331.819 * $eq - 508.738 * |
|
731 | - $sat->deep_arg->eosq + 266.724 * $eoc; |
|
732 | - $g310 = -346.844 + 1582.851 * $eq - 2415.925 * |
|
733 | - $sat->deep_arg->eosq + 1246.113 * $eoc; |
|
734 | - $g322 = -342.585 + 1554.908 * $eq - 2366.899 * |
|
735 | - $sat->deep_arg->eosq + 1215.972 * $eoc; |
|
736 | - $g410 = -1052.797 + 4758.686 * $eq - 7193.992 * |
|
737 | - $sat->deep_arg->eosq + 3651.957 * $eoc; |
|
738 | - $g422 = -3581.69 + 16178.11 * $eq - 24462.77 * |
|
739 | - $sat->deep_arg->eosq+ 12422.52 * $eoc; |
|
730 | + $g211 = -72.099 + 331.819*$eq - 508.738* |
|
731 | + $sat->deep_arg->eosq + 266.724*$eoc; |
|
732 | + $g310 = -346.844 + 1582.851*$eq - 2415.925* |
|
733 | + $sat->deep_arg->eosq + 1246.113*$eoc; |
|
734 | + $g322 = -342.585 + 1554.908*$eq - 2366.899* |
|
735 | + $sat->deep_arg->eosq + 1215.972*$eoc; |
|
736 | + $g410 = -1052.797 + 4758.686*$eq - 7193.992* |
|
737 | + $sat->deep_arg->eosq + 3651.957*$eoc; |
|
738 | + $g422 = -3581.69 + 16178.11*$eq - 24462.77* |
|
739 | + $sat->deep_arg->eosq + 12422.52*$eoc; |
|
740 | 740 | if ($eq <= 0.715) { |
741 | - $g520 = 1464.74 - 4664.75 * $eq + 3763.64 * $sat->deep_arg->eosq; |
|
741 | + $g520 = 1464.74 - 4664.75*$eq + 3763.64*$sat->deep_arg->eosq; |
|
742 | 742 | } else { |
743 | - $g520 = -5149.66 + 29936.92 * $eq - 54087.36 * |
|
744 | - $sat->deep_arg->eosq + 31324.56 * $eoc; |
|
743 | + $g520 = -5149.66 + 29936.92*$eq - 54087.36* |
|
744 | + $sat->deep_arg->eosq + 31324.56*$eoc; |
|
745 | 745 | } |
746 | 746 | } /* End if (eq <= 0.65) */ |
747 | 747 | |
748 | 748 | if ($eq < 0.7) { |
749 | - $g533 = -919.2277 + 4988.61 * $eq - 9064.77 * |
|
750 | - $sat->deep_arg->eosq + 5542.21 * $eoc; |
|
751 | - $g521 = -822.71072 + 4568.6173 * $eq - 8491.4146 * |
|
752 | - $sat->deep_arg->eosq + 5337.524 * $eoc; |
|
753 | - $g532 = -853.666 + 4690.25 * $eq - 8624.77 * |
|
754 | - $sat->deep_arg->eosq + 5341.4 * $eoc; |
|
749 | + $g533 = -919.2277 + 4988.61*$eq - 9064.77* |
|
750 | + $sat->deep_arg->eosq + 5542.21*$eoc; |
|
751 | + $g521 = -822.71072 + 4568.6173*$eq - 8491.4146* |
|
752 | + $sat->deep_arg->eosq + 5337.524*$eoc; |
|
753 | + $g532 = -853.666 + 4690.25*$eq - 8624.77* |
|
754 | + $sat->deep_arg->eosq + 5341.4*$eoc; |
|
755 | 755 | } |
756 | 756 | else { |
757 | - $g533 = -37995.78 + 161616.52 * $eq - 229838.2* |
|
758 | - $sat->deep_arg->eosq + 109377.94 * $eoc; |
|
759 | - $g521 = -51752.104 + 218913.95 * $eq - 309468.16* |
|
760 | - $sat->deep_arg->eosq + 146349.42 * $eoc; |
|
761 | - $g532 = -40023.88 + 170470.89 * $eq - 242699.48* |
|
762 | - $sat->deep_arg->eosq + 115605.82 * $eoc; |
|
757 | + $g533 = -37995.78 + 161616.52*$eq - 229838.2* |
|
758 | + $sat->deep_arg->eosq + 109377.94*$eoc; |
|
759 | + $g521 = -51752.104 + 218913.95*$eq - 309468.16* |
|
760 | + $sat->deep_arg->eosq + 146349.42*$eoc; |
|
761 | + $g532 = -40023.88 + 170470.89*$eq - 242699.48* |
|
762 | + $sat->deep_arg->eosq + 115605.82*$eoc; |
|
763 | 763 | } /* End if (eq <= 0.7) */ |
764 | 764 | |
765 | - $sini2 = $sat->deep_arg->sinio * $sat->deep_arg->sinio; |
|
766 | - $f220 = 0.75 * (1 + 2 * $sat->deep_arg->cosio + $sat->deep_arg->theta2); |
|
767 | - $f221 = 1.5 * $sini2; |
|
768 | - $f321 = 1.875 * $sat->deep_arg->sinio * (1 - 2 * |
|
769 | - $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2); |
|
770 | - $f322 = -1.875 * $sat->deep_arg->sinio * (1 + 2* |
|
771 | - $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2); |
|
772 | - $f441 = 35 * $sini2 * $f220; |
|
773 | - $f442 = 39.3750 * $sini2 * $sini2; |
|
774 | - $f522 = 9.84375 * $sat->deep_arg->sinio * ($sini2 * (1 - 2 * $sat->deep_arg->cosio - 5 * |
|
775 | - $sat->deep_arg->theta2) + 0.33333333 * (-2 + 4 * $sat->deep_arg->cosio + |
|
776 | - 6 * $sat->deep_arg->theta2)); |
|
777 | - $f523 = $sat->deep_arg->sinio * (4.92187512 * $sini2 * (-2 - 4 * |
|
778 | - $sat->deep_arg->cosio + 10 * $sat->deep_arg->theta2) + 6.56250012 |
|
779 | - * (1 + 2 * $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2)); |
|
780 | - $f542 = 29.53125 * $sat->deep_arg->sinio * (2 - 8 * |
|
781 | - $sat->deep_arg->cosio + $sat->deep_arg->theta2 * |
|
782 | - (-12 + 8 * $sat->deep_arg->cosio + 10 * $sat->deep_arg->theta2)); |
|
783 | - $f543 = 29.53125 * $sat->deep_arg->sinio * (-2 - 8 * $sat->deep_arg->cosio + |
|
784 | - $sat->deep_arg->theta2 * (12 + 8 * $sat->deep_arg->cosio - 10 * |
|
765 | + $sini2 = $sat->deep_arg->sinio*$sat->deep_arg->sinio; |
|
766 | + $f220 = 0.75*(1 + 2*$sat->deep_arg->cosio + $sat->deep_arg->theta2); |
|
767 | + $f221 = 1.5*$sini2; |
|
768 | + $f321 = 1.875*$sat->deep_arg->sinio*(1 - 2* |
|
769 | + $sat->deep_arg->cosio - 3*$sat->deep_arg->theta2); |
|
770 | + $f322 = -1.875*$sat->deep_arg->sinio*(1 + 2* |
|
771 | + $sat->deep_arg->cosio - 3*$sat->deep_arg->theta2); |
|
772 | + $f441 = 35*$sini2*$f220; |
|
773 | + $f442 = 39.3750*$sini2*$sini2; |
|
774 | + $f522 = 9.84375*$sat->deep_arg->sinio*($sini2*(1 - 2*$sat->deep_arg->cosio - 5* |
|
775 | + $sat->deep_arg->theta2) + 0.33333333*(-2 + 4*$sat->deep_arg->cosio + |
|
776 | + 6*$sat->deep_arg->theta2)); |
|
777 | + $f523 = $sat->deep_arg->sinio*(4.92187512*$sini2*(-2 - 4* |
|
778 | + $sat->deep_arg->cosio + 10*$sat->deep_arg->theta2) + 6.56250012 |
|
779 | + * (1 + 2*$sat->deep_arg->cosio - 3*$sat->deep_arg->theta2)); |
|
780 | + $f542 = 29.53125*$sat->deep_arg->sinio*(2 - 8* |
|
781 | + $sat->deep_arg->cosio + $sat->deep_arg->theta2* |
|
782 | + (-12 + 8*$sat->deep_arg->cosio + 10*$sat->deep_arg->theta2)); |
|
783 | + $f543 = 29.53125*$sat->deep_arg->sinio*(-2 - 8*$sat->deep_arg->cosio + |
|
784 | + $sat->deep_arg->theta2*(12 + 8*$sat->deep_arg->cosio - 10* |
|
785 | 785 | $sat->deep_arg->theta2)); |
786 | - $xno2 = $sat->dps->xnq * $sat->dps->xnq; |
|
787 | - $ainv2 = $aqnv * $aqnv; |
|
788 | - $temp1 = 3 * $xno2 * $ainv2; |
|
789 | - $temp = $temp1 * Predict::root22; |
|
790 | - $sat->dps->d2201 = $temp * $f220 * $g201; |
|
791 | - $sat->dps->d2211 = $temp * $f221 * $g211; |
|
792 | - $temp1 = $temp1 * $aqnv; |
|
793 | - $temp = $temp1 * Predict::root32; |
|
794 | - $sat->dps->d3210 = $temp * $f321 * $g310; |
|
795 | - $sat->dps->d3222 = $temp * $f322 * $g322; |
|
796 | - $temp1 = $temp1 * $aqnv; |
|
797 | - $temp = 2 * $temp1 * Predict::root44; |
|
798 | - $sat->dps->d4410 = $temp * $f441 * $g410; |
|
799 | - $sat->dps->d4422 = $temp * $f442 * $g422; |
|
800 | - $temp1 = $temp1 * $aqnv; |
|
801 | - $temp = $temp1 * Predict::root52; |
|
802 | - $sat->dps->d5220 = $temp * $f522 * $g520; |
|
803 | - $sat->dps->d5232 = $temp * $f523 * $g532; |
|
804 | - $temp = 2 * $temp1 * Predict::root54; |
|
805 | - $sat->dps->d5421 = $temp * $f542 * $g521; |
|
806 | - $sat->dps->d5433 = $temp * $f543 * $g533; |
|
786 | + $xno2 = $sat->dps->xnq*$sat->dps->xnq; |
|
787 | + $ainv2 = $aqnv*$aqnv; |
|
788 | + $temp1 = 3*$xno2*$ainv2; |
|
789 | + $temp = $temp1*Predict::root22; |
|
790 | + $sat->dps->d2201 = $temp*$f220*$g201; |
|
791 | + $sat->dps->d2211 = $temp*$f221*$g211; |
|
792 | + $temp1 = $temp1*$aqnv; |
|
793 | + $temp = $temp1*Predict::root32; |
|
794 | + $sat->dps->d3210 = $temp*$f321*$g310; |
|
795 | + $sat->dps->d3222 = $temp*$f322*$g322; |
|
796 | + $temp1 = $temp1*$aqnv; |
|
797 | + $temp = 2*$temp1*Predict::root44; |
|
798 | + $sat->dps->d4410 = $temp*$f441*$g410; |
|
799 | + $sat->dps->d4422 = $temp*$f442*$g422; |
|
800 | + $temp1 = $temp1*$aqnv; |
|
801 | + $temp = $temp1*Predict::root52; |
|
802 | + $sat->dps->d5220 = $temp*$f522*$g520; |
|
803 | + $sat->dps->d5232 = $temp*$f523*$g532; |
|
804 | + $temp = 2*$temp1*Predict::root54; |
|
805 | + $sat->dps->d5421 = $temp*$f542*$g521; |
|
806 | + $sat->dps->d5433 = $temp*$f543*$g533; |
|
807 | 807 | $sat->dps->xlamo = $xmao + $sat->tle->xnodeo + $sat->tle->xnodeo - $sat->dps->thgr - $sat->dps->thgr; |
808 | 808 | $bfact = $sat->deep_arg->xmdot + $sat->deep_arg->xnodot + |
809 | 809 | $sat->deep_arg->xnodot - Predict::thdt - Predict::thdt; |
@@ -812,18 +812,18 @@ discard block |
||
812 | 812 | $sat->flags |= self::RESONANCE_FLAG; |
813 | 813 | $sat->flags |= self::SYNCHRONOUS_FLAG; |
814 | 814 | /* Synchronous resonance terms initialization */ |
815 | - $g200 = 1 + $sat->deep_arg->eosq * (-2.5 + 0.8125 * $sat->deep_arg->eosq); |
|
816 | - $g310 = 1 + 2 * $sat->deep_arg->eosq; |
|
817 | - $g300 = 1 + $sat->deep_arg->eosq * (-6 + 6.60937 * $sat->deep_arg->eosq); |
|
818 | - $f220 = 0.75 * (1 + $sat->deep_arg->cosio) * (1 + $sat->deep_arg->cosio); |
|
819 | - $f311 = 0.9375 * $sat->deep_arg->sinio * $sat->deep_arg->sinio * |
|
820 | - (1 + 3 * $sat->deep_arg->cosio) - 0.75 * (1 + $sat->deep_arg->cosio); |
|
815 | + $g200 = 1 + $sat->deep_arg->eosq*(-2.5 + 0.8125*$sat->deep_arg->eosq); |
|
816 | + $g310 = 1 + 2*$sat->deep_arg->eosq; |
|
817 | + $g300 = 1 + $sat->deep_arg->eosq*(-6 + 6.60937*$sat->deep_arg->eosq); |
|
818 | + $f220 = 0.75*(1 + $sat->deep_arg->cosio)*(1 + $sat->deep_arg->cosio); |
|
819 | + $f311 = 0.9375*$sat->deep_arg->sinio*$sat->deep_arg->sinio* |
|
820 | + (1 + 3*$sat->deep_arg->cosio) - 0.75*(1 + $sat->deep_arg->cosio); |
|
821 | 821 | $f330 = 1 + $sat->deep_arg->cosio; |
822 | - $f330 = 1.875 * $f330 * $f330 * $f330; |
|
823 | - $sat->dps->del1 = 3 * $sat->dps->xnq * $sat->dps->xnq * $aqnv * $aqnv; |
|
824 | - $sat->dps->del2 = 2 * $sat->dps->del1 * $f220 * $g200 * Predict::q22; |
|
825 | - $sat->dps->del3 = 3 * $sat->dps->del1 * $f330 * $g300 * Predict::q33 * $aqnv; |
|
826 | - $sat->dps->del1 = $sat->dps->del1 * $f311 * $g310 * Predict::q31 * $aqnv; |
|
822 | + $f330 = 1.875*$f330*$f330*$f330; |
|
823 | + $sat->dps->del1 = 3*$sat->dps->xnq*$sat->dps->xnq*$aqnv*$aqnv; |
|
824 | + $sat->dps->del2 = 2*$sat->dps->del1*$f220*$g200*Predict::q22; |
|
825 | + $sat->dps->del3 = 3*$sat->dps->del1*$f330*$g300*Predict::q33*$aqnv; |
|
826 | + $sat->dps->del1 = $sat->dps->del1*$f311*$g310*Predict::q31*$aqnv; |
|
827 | 827 | $sat->dps->fasx2 = 0.13130908; |
828 | 828 | $sat->dps->fasx4 = 2.8843198; |
829 | 829 | $sat->dps->fasx6 = 0.37448087; |
@@ -845,24 +845,24 @@ discard block |
||
845 | 845 | return; |
846 | 846 | |
847 | 847 | case self::dpsec: /* Entrance for deep space secular effects */ |
848 | - $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->ssl * $sat->deep_arg->t; |
|
849 | - $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $sat->dps->ssg * $sat->deep_arg->t; |
|
850 | - $sat->deep_arg->xnode = $sat->deep_arg->xnode + $sat->dps->ssh * $sat->deep_arg->t; |
|
851 | - $sat->deep_arg->em = $sat->tle->eo + $sat->dps->sse * $sat->deep_arg->t; |
|
852 | - $sat->deep_arg->xinc = $sat->tle->xincl + $sat->dps->ssi * $sat->deep_arg->t; |
|
848 | + $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->ssl*$sat->deep_arg->t; |
|
849 | + $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $sat->dps->ssg*$sat->deep_arg->t; |
|
850 | + $sat->deep_arg->xnode = $sat->deep_arg->xnode + $sat->dps->ssh*$sat->deep_arg->t; |
|
851 | + $sat->deep_arg->em = $sat->tle->eo + $sat->dps->sse*$sat->deep_arg->t; |
|
852 | + $sat->deep_arg->xinc = $sat->tle->xincl + $sat->dps->ssi*$sat->deep_arg->t; |
|
853 | 853 | if ($sat->deep_arg->xinc < 0) { |
854 | 854 | $sat->deep_arg->xinc = -$sat->deep_arg->xinc; |
855 | 855 | $sat->deep_arg->xnode = $sat->deep_arg->xnode + Predict::pi; |
856 | 856 | $sat->deep_arg->omgadf = $sat->deep_arg->omgadf - Predict::pi; |
857 | 857 | } |
858 | - if(~$sat->flags & self::RESONANCE_FLAG ) { |
|
858 | + if (~$sat->flags&self::RESONANCE_FLAG) { |
|
859 | 859 | return; |
860 | 860 | } |
861 | 861 | |
862 | 862 | do { |
863 | - if ( ($sat->dps->atime == 0) || |
|
863 | + if (($sat->dps->atime == 0) || |
|
864 | 864 | (($sat->deep_arg->t >= 0) && ($sat->dps->atime < 0)) || |
865 | - (($sat->deep_arg->t < 0) && ($sat->dps->atime >= 0)) ) { |
|
865 | + (($sat->deep_arg->t < 0) && ($sat->dps->atime >= 0))) { |
|
866 | 866 | /* Epoch restart */ |
867 | 867 | if ($sat->deep_arg->t >= 0) { |
868 | 868 | $delt = $sat->dps->stepp; |
@@ -899,59 +899,59 @@ discard block |
||
899 | 899 | } else { |
900 | 900 | $delt = $sat->dps->stepp; |
901 | 901 | } |
902 | - $sat->flags |= (self::DO_LOOP_FLAG | self::EPOCH_RESTART_FLAG); |
|
902 | + $sat->flags |= (self::DO_LOOP_FLAG|self::EPOCH_RESTART_FLAG); |
|
903 | 903 | } |
904 | 904 | |
905 | 905 | /* Dot terms calculated */ |
906 | - if ($sat->flags & self::SYNCHRONOUS_FLAG) { |
|
907 | - $xndot = $sat->dps->del1 * sin($sat->dps->xli - $sat->dps->fasx2) + $sat->dps->del2 * sin(2 * ($sat->dps->xli - $sat->dps->fasx4)) |
|
908 | - + $sat->dps->del3 * sin(3 * ($sat->dps->xli - $sat->dps->fasx6)); |
|
909 | - $xnddt = $sat->dps->del1 * cos($sat->dps->xli - $sat->dps->fasx2) + 2 * $sat->dps->del2 * cos(2 * ($sat->dps->xli - $sat->dps->fasx4)) |
|
910 | - + 3 * $sat->dps->del3 * cos(3 * ($sat->dps->xli - $sat->dps->fasx6)); |
|
906 | + if ($sat->flags&self::SYNCHRONOUS_FLAG) { |
|
907 | + $xndot = $sat->dps->del1*sin($sat->dps->xli - $sat->dps->fasx2) + $sat->dps->del2*sin(2*($sat->dps->xli - $sat->dps->fasx4)) |
|
908 | + + $sat->dps->del3*sin(3*($sat->dps->xli - $sat->dps->fasx6)); |
|
909 | + $xnddt = $sat->dps->del1*cos($sat->dps->xli - $sat->dps->fasx2) + 2*$sat->dps->del2*cos(2*($sat->dps->xli - $sat->dps->fasx4)) |
|
910 | + + 3*$sat->dps->del3*cos(3*($sat->dps->xli - $sat->dps->fasx6)); |
|
911 | 911 | } else { |
912 | - $xomi = $sat->dps->omegaq + $sat->deep_arg->omgdot * $sat->dps->atime; |
|
912 | + $xomi = $sat->dps->omegaq + $sat->deep_arg->omgdot*$sat->dps->atime; |
|
913 | 913 | $x2omi = $xomi + $xomi; |
914 | 914 | $x2li = $sat->dps->xli + $sat->dps->xli; |
915 | - $xndot = $sat->dps->d2201 * sin($x2omi + $sat->dps->xli - Predict::g22) |
|
916 | - + $sat->dps->d2211 * sin($sat->dps->xli - Predict::g22) |
|
917 | - + $sat->dps->d3210 * sin($xomi + $sat->dps->xli - Predict::g32) |
|
918 | - + $sat->dps->d3222 * sin(-$xomi + $sat->dps->xli - Predict::g32) |
|
919 | - + $sat->dps->d4410 * sin($x2omi + $x2li- Predict::g44) |
|
920 | - + $sat->dps->d4422 * sin($x2li- Predict::g44) |
|
921 | - + $sat->dps->d5220 * sin($xomi + $sat->dps->xli- Predict::g52) |
|
922 | - + $sat->dps->d5232 * sin(-$xomi + $sat->dps->xli- Predict::g52) |
|
923 | - + $sat->dps->d5421 * sin($xomi + $x2li - Predict::g54) |
|
924 | - + $sat->dps->d5433 * sin(-$xomi + $x2li - Predict::g54); |
|
925 | - $xnddt = $sat->dps->d2201 * cos($x2omi + $sat->dps->xli- Predict::g22) |
|
926 | - + $sat->dps->d2211 * cos($sat->dps->xli - Predict::g22) |
|
927 | - + $sat->dps->d3210 * cos($xomi + $sat->dps->xli - Predict::g32) |
|
928 | - + $sat->dps->d3222 * cos(-$xomi + $sat->dps->xli - Predict::g32) |
|
929 | - + $sat->dps->d5220 * cos($xomi + $sat->dps->xli - Predict::g52) |
|
930 | - + $sat->dps->d5232 * cos(-$xomi + $sat->dps->xli - Predict::g52) |
|
931 | - + 2 * ($sat->dps->d4410 * cos($x2omi + $x2li - Predict::g44) |
|
932 | - + $sat->dps->d4422 * cos($x2li - Predict::g44) |
|
933 | - + $sat->dps->d5421 * cos($xomi + $x2li - Predict::g54) |
|
934 | - + $sat->dps->d5433 * cos(-$xomi + $x2li - Predict::g54)); |
|
915 | + $xndot = $sat->dps->d2201*sin($x2omi + $sat->dps->xli - Predict::g22) |
|
916 | + + $sat->dps->d2211*sin($sat->dps->xli - Predict::g22) |
|
917 | + + $sat->dps->d3210*sin($xomi + $sat->dps->xli - Predict::g32) |
|
918 | + + $sat->dps->d3222*sin(-$xomi + $sat->dps->xli - Predict::g32) |
|
919 | + + $sat->dps->d4410*sin($x2omi + $x2li - Predict::g44) |
|
920 | + + $sat->dps->d4422*sin($x2li - Predict::g44) |
|
921 | + + $sat->dps->d5220*sin($xomi + $sat->dps->xli - Predict::g52) |
|
922 | + + $sat->dps->d5232*sin(-$xomi + $sat->dps->xli - Predict::g52) |
|
923 | + + $sat->dps->d5421*sin($xomi + $x2li - Predict::g54) |
|
924 | + + $sat->dps->d5433*sin(-$xomi + $x2li - Predict::g54); |
|
925 | + $xnddt = $sat->dps->d2201*cos($x2omi + $sat->dps->xli - Predict::g22) |
|
926 | + + $sat->dps->d2211*cos($sat->dps->xli - Predict::g22) |
|
927 | + + $sat->dps->d3210*cos($xomi + $sat->dps->xli - Predict::g32) |
|
928 | + + $sat->dps->d3222*cos(-$xomi + $sat->dps->xli - Predict::g32) |
|
929 | + + $sat->dps->d5220*cos($xomi + $sat->dps->xli - Predict::g52) |
|
930 | + + $sat->dps->d5232*cos(-$xomi + $sat->dps->xli - Predict::g52) |
|
931 | + + 2*($sat->dps->d4410*cos($x2omi + $x2li - Predict::g44) |
|
932 | + + $sat->dps->d4422*cos($x2li - Predict::g44) |
|
933 | + + $sat->dps->d5421*cos($xomi + $x2li - Predict::g54) |
|
934 | + + $sat->dps->d5433*cos(-$xomi + $x2li - Predict::g54)); |
|
935 | 935 | } /* End of if (isFlagSet(SYNCHRONOUS_FLAG)) */ |
936 | 936 | |
937 | 937 | $xldot = $sat->dps->xni + $sat->dps->xfact; |
938 | - $xnddt = $xnddt * $xldot; |
|
938 | + $xnddt = $xnddt*$xldot; |
|
939 | 939 | |
940 | - if ($sat->flags & self::DO_LOOP_FLAG) { |
|
941 | - $sat->dps->xli = $sat->dps->xli + $xldot * $delt + $xndot * $sat->dps->step2; |
|
942 | - $sat->dps->xni = $sat->dps->xni + $xndot * $delt + $xnddt * $sat->dps->step2; |
|
940 | + if ($sat->flags&self::DO_LOOP_FLAG) { |
|
941 | + $sat->dps->xli = $sat->dps->xli + $xldot*$delt + $xndot*$sat->dps->step2; |
|
942 | + $sat->dps->xni = $sat->dps->xni + $xndot*$delt + $xnddt*$sat->dps->step2; |
|
943 | 943 | $sat->dps->atime = $sat->dps->atime + $delt; |
944 | 944 | } |
945 | - } while (($sat->flags & self::DO_LOOP_FLAG) && |
|
946 | - (~$sat->flags & self::EPOCH_RESTART_FLAG)); |
|
945 | + } while (($sat->flags&self::DO_LOOP_FLAG) && |
|
946 | + (~$sat->flags&self::EPOCH_RESTART_FLAG)); |
|
947 | 947 | } |
948 | - while (($sat->flags & self::DO_LOOP_FLAG) && ($sat->flags & self::EPOCH_RESTART_FLAG)); |
|
948 | + while (($sat->flags&self::DO_LOOP_FLAG) && ($sat->flags&self::EPOCH_RESTART_FLAG)); |
|
949 | 949 | |
950 | - $sat->deep_arg->xn = $sat->dps->xni + $xndot * $ft + $xnddt * $ft * $ft * 0.5; |
|
951 | - $xl = $sat->dps->xli + $xldot * $ft + $xndot * $ft * $ft * 0.5; |
|
952 | - $temp = -$sat->deep_arg->xnode + $sat->dps->thgr + $sat->deep_arg->t * Predict::thdt; |
|
950 | + $sat->deep_arg->xn = $sat->dps->xni + $xndot*$ft + $xnddt*$ft*$ft*0.5; |
|
951 | + $xl = $sat->dps->xli + $xldot*$ft + $xndot*$ft*$ft*0.5; |
|
952 | + $temp = -$sat->deep_arg->xnode + $sat->dps->thgr + $sat->deep_arg->t*Predict::thdt; |
|
953 | 953 | |
954 | - if (~$sat->flags & self::SYNCHRONOUS_FLAG) { |
|
954 | + if (~$sat->flags&self::SYNCHRONOUS_FLAG) { |
|
955 | 955 | $sat->deep_arg->xll = $xl + $temp + $temp; |
956 | 956 | } else { |
957 | 957 | $sat->deep_arg->xll = $xl - $sat->deep_arg->omgadf + $temp; |
@@ -965,26 +965,26 @@ discard block |
||
965 | 965 | $cosis = cos($sat->deep_arg->xinc); |
966 | 966 | if (abs($sat->dps->savtsn - $sat->deep_arg->t) >= 30) { |
967 | 967 | $sat->dps->savtsn = $sat->deep_arg->t; |
968 | - $zm = $sat->dps->zmos + Predict::zns * $sat->deep_arg->t; |
|
969 | - $zf = $zm + 2 * Predict::zes * sin($zm); |
|
968 | + $zm = $sat->dps->zmos + Predict::zns*$sat->deep_arg->t; |
|
969 | + $zf = $zm + 2*Predict::zes*sin($zm); |
|
970 | 970 | $sinzf = sin($zf); |
971 | - $f2 = 0.5 * $sinzf * $sinzf - 0.25; |
|
972 | - $f3 = -0.5 * $sinzf * cos($zf); |
|
973 | - $ses = $sat->dps->se2 * $f2 + $sat->dps->se3 * $f3; |
|
974 | - $sis = $sat->dps->si2 * $f2 + $sat->dps->si3 * $f3; |
|
975 | - $sls = $sat->dps->sl2 * $f2 + $sat->dps->sl3 * $f3 + $sat->dps->sl4 * $sinzf; |
|
976 | - $sat->dps->sghs = $sat->dps->sgh2 * $f2 + $sat->dps->sgh3 * $f3 + $sat->dps->sgh4 * $sinzf; |
|
977 | - $sat->dps->shs = $sat->dps->sh2 * $f2 + $sat->dps->sh3 * $f3; |
|
978 | - $zm = $sat->dps->zmol + Predict::znl * $sat->deep_arg->t; |
|
979 | - $zf = $zm + 2 * Predict::zel * sin($zm); |
|
971 | + $f2 = 0.5*$sinzf*$sinzf - 0.25; |
|
972 | + $f3 = -0.5*$sinzf*cos($zf); |
|
973 | + $ses = $sat->dps->se2*$f2 + $sat->dps->se3*$f3; |
|
974 | + $sis = $sat->dps->si2*$f2 + $sat->dps->si3*$f3; |
|
975 | + $sls = $sat->dps->sl2*$f2 + $sat->dps->sl3*$f3 + $sat->dps->sl4*$sinzf; |
|
976 | + $sat->dps->sghs = $sat->dps->sgh2*$f2 + $sat->dps->sgh3*$f3 + $sat->dps->sgh4*$sinzf; |
|
977 | + $sat->dps->shs = $sat->dps->sh2*$f2 + $sat->dps->sh3*$f3; |
|
978 | + $zm = $sat->dps->zmol + Predict::znl*$sat->deep_arg->t; |
|
979 | + $zf = $zm + 2*Predict::zel*sin($zm); |
|
980 | 980 | $sinzf = sin($zf); |
981 | - $f2 = 0.5 * $sinzf * $sinzf - 0.25; |
|
982 | - $f3 = -0.5 * $sinzf * cos($zf); |
|
983 | - $sel = $sat->dps->ee2 * $f2 + $sat->dps->e3 * $f3; |
|
984 | - $sil = $sat->dps->xi2 * $f2 + $sat->dps->xi3 * $f3; |
|
985 | - $sll = $sat->dps->xl2 * $f2 + $sat->dps->xl3 * $f3 + $sat->dps->xl4 * $sinzf; |
|
986 | - $sat->dps->sghl = $sat->dps->xgh2 * $f2 + $sat->dps->xgh3 * $f3 + $sat->dps->xgh4 * $sinzf; |
|
987 | - $sat->dps->sh1 = $sat->dps->xh2 * $f2 + $sat->dps->xh3 * $f3; |
|
981 | + $f2 = 0.5*$sinzf*$sinzf - 0.25; |
|
982 | + $f3 = -0.5*$sinzf*cos($zf); |
|
983 | + $sel = $sat->dps->ee2*$f2 + $sat->dps->e3*$f3; |
|
984 | + $sil = $sat->dps->xi2*$f2 + $sat->dps->xi3*$f3; |
|
985 | + $sll = $sat->dps->xl2*$f2 + $sat->dps->xl3*$f3 + $sat->dps->xl4*$sinzf; |
|
986 | + $sat->dps->sghl = $sat->dps->xgh2*$f2 + $sat->dps->xgh3*$f3 + $sat->dps->xgh4*$sinzf; |
|
987 | + $sat->dps->sh1 = $sat->dps->xh2*$f2 + $sat->dps->xh3*$f3; |
|
988 | 988 | $sat->dps->pe = $ses + $sel; |
989 | 989 | $sat->dps->pinc = $sis + $sil; |
990 | 990 | $sat->dps->pl = $sls + $sll; |
@@ -997,8 +997,8 @@ discard block |
||
997 | 997 | |
998 | 998 | if ($sat->dps->xqncl >= 0.2) { |
999 | 999 | /* Apply periodics directly */ |
1000 | - $ph = $ph / $sat->deep_arg->sinio; |
|
1001 | - $pgh = $pgh - $sat->deep_arg->cosio * $ph; |
|
1000 | + $ph = $ph/$sat->deep_arg->sinio; |
|
1001 | + $pgh = $pgh - $sat->deep_arg->cosio*$ph; |
|
1002 | 1002 | $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $pgh; |
1003 | 1003 | $sat->deep_arg->xnode = $sat->deep_arg->xnode + $ph; |
1004 | 1004 | $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->pl; |
@@ -1006,22 +1006,22 @@ discard block |
||
1006 | 1006 | /* Apply periodics with Lyddane modification */ |
1007 | 1007 | $sinok = sin($sat->deep_arg->xnode); |
1008 | 1008 | $cosok = cos($sat->deep_arg->xnode); |
1009 | - $alfdp = $sinis * $sinok; |
|
1010 | - $betdp = $sinis * $cosok; |
|
1011 | - $dalf = $ph * $cosok + $sat->dps->pinc * $cosis * $sinok; |
|
1012 | - $dbet = -$ph * $sinok + $sat->dps->pinc * $cosis * $cosok; |
|
1009 | + $alfdp = $sinis*$sinok; |
|
1010 | + $betdp = $sinis*$cosok; |
|
1011 | + $dalf = $ph*$cosok + $sat->dps->pinc*$cosis*$sinok; |
|
1012 | + $dbet = -$ph*$sinok + $sat->dps->pinc*$cosis*$cosok; |
|
1013 | 1013 | $alfdp = $alfdp + $dalf; |
1014 | 1014 | $betdp = $betdp + $dbet; |
1015 | 1015 | $sat->deep_arg->xnode = Predict_Math::FMod2p($sat->deep_arg->xnode); |
1016 | - $xls = $sat->deep_arg->xll + $sat->deep_arg->omgadf + $cosis * $sat->deep_arg->xnode; |
|
1017 | - $dls = $sat->dps->pl + $pgh - $sat->dps->pinc * $sat->deep_arg->xnode * $sinis; |
|
1016 | + $xls = $sat->deep_arg->xll + $sat->deep_arg->omgadf + $cosis*$sat->deep_arg->xnode; |
|
1017 | + $dls = $sat->dps->pl + $pgh - $sat->dps->pinc*$sat->deep_arg->xnode*$sinis; |
|
1018 | 1018 | $xls = $xls + $dls; |
1019 | 1019 | $xnoh = $sat->deep_arg->xnode; |
1020 | 1020 | $sat->deep_arg->xnode = Predict_Math::AcTan($alfdp, $betdp); |
1021 | 1021 | |
1022 | 1022 | /* This is a patch to Lyddane modification */ |
1023 | 1023 | /* suggested by Rob Matson. */ |
1024 | - if(abs($xnoh - $sat->deep_arg->xnode) > Predict::pi) { |
|
1024 | + if (abs($xnoh - $sat->deep_arg->xnode) > Predict::pi) { |
|
1025 | 1025 | if ($sat->deep_arg->xnode < $xnoh) { |
1026 | 1026 | $sat->deep_arg->xnode += Predict::twopi; |
1027 | 1027 | } else { |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->pl; |
1033 | - $sat->deep_arg->omgadf = $xls - $sat->deep_arg->xll - cos($sat->deep_arg->xinc) * |
|
1033 | + $sat->deep_arg->omgadf = $xls - $sat->deep_arg->xll - cos($sat->deep_arg->xinc)* |
|
1034 | 1034 | $sat->deep_arg->xnode; |
1035 | 1035 | } /* End case dpper: */ |
1036 | 1036 | return; |
@@ -12,9 +12,9 @@ |
||
12 | 12 | */ |
13 | 13 | class Predict_PassDetail |
14 | 14 | { |
15 | - public $time; /*!< time in "jul_utc" */ |
|
16 | - public $pos; /*!< Raw unprocessed position at time */ |
|
17 | - public $vel; /*!< Raw unprocessed velocity at time */ |
|
15 | + public $time; /*!< time in "jul_utc" */ |
|
16 | + public $pos; /*!< Raw unprocessed position at time */ |
|
17 | + public $vel; /*!< Raw unprocessed velocity at time */ |
|
18 | 18 | public $velo; |
19 | 19 | public $az; |
20 | 20 | public $el; |
@@ -5,8 +5,8 @@ |
||
5 | 5 | */ |
6 | 6 | class Predict_ObsSet |
7 | 7 | { |
8 | - public $az = 0.0; /*!< Azimuth [deg] */ |
|
9 | - public $el = 0.0; /*!< Elevation [deg] */ |
|
10 | - public $range = 0.0; /*!< Range [km] */ |
|
11 | - public $range_rate = 0.0; /*!< Velocity [km/sec] */ |
|
8 | + public $az = 0.0; /*!< Azimuth [deg] */ |
|
9 | + public $el = 0.0; /*!< Elevation [deg] */ |
|
10 | + public $range = 0.0; /*!< Range [km] */ |
|
11 | + public $range_rate = 0.0; /*!< Velocity [km/sec] */ |
|
12 | 12 | } |
@@ -12,30 +12,30 @@ discard block |
||
12 | 12 | */ |
13 | 13 | class Predict_TLE |
14 | 14 | { |
15 | - public $header; /* Header line of TLE file */ |
|
16 | - public $line1; /* Line 1 of TLE */ |
|
17 | - public $line2; /* Line 2 of TLE */ |
|
18 | - public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
15 | + public $header; /* Header line of TLE file */ |
|
16 | + public $line1; /* Line 1 of TLE */ |
|
17 | + public $line2; /* Line 2 of TLE */ |
|
18 | + public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
19 | 19 | public $epoch_year; /*!< Epoch: year */ |
20 | - public $epoch_day; /*!< Epoch: day of year */ |
|
21 | - public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | - public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | - public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | - public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | - public $xincl; /*!< Inclination */ |
|
26 | - public $xnodeo; /*!< R.A.A.N. */ |
|
27 | - public $eo; /*!< Eccentricity */ |
|
28 | - public $omegao; /*!< argument of perigee */ |
|
29 | - public $xmo; /*!< mean anomaly */ |
|
30 | - public $xno; /*!< mean motion */ |
|
31 | - |
|
32 | - public $catnr; /*!< Catalogue Number. */ |
|
33 | - public $elset; /*!< Element Set number. */ |
|
34 | - public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | - |
|
36 | - public $sat_name; /*!< Satellite name string. */ |
|
37 | - public $idesg; /*!< International Designator. */ |
|
38 | - public $status; /*!< Operational status. */ |
|
20 | + public $epoch_day; /*!< Epoch: day of year */ |
|
21 | + public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | + public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | + public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | + public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | + public $xincl; /*!< Inclination */ |
|
26 | + public $xnodeo; /*!< R.A.A.N. */ |
|
27 | + public $eo; /*!< Eccentricity */ |
|
28 | + public $omegao; /*!< argument of perigee */ |
|
29 | + public $xmo; /*!< mean anomaly */ |
|
30 | + public $xno; /*!< mean motion */ |
|
31 | + |
|
32 | + public $catnr; /*!< Catalogue Number. */ |
|
33 | + public $elset; /*!< Element Set number. */ |
|
34 | + public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | + |
|
36 | + public $sat_name; /*!< Satellite name string. */ |
|
37 | + public $idesg; /*!< International Designator. */ |
|
38 | + public $status; /*!< Operational status. */ |
|
39 | 39 | |
40 | 40 | /* values needed for squint calculations */ |
41 | 41 | public $xincl1; |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $this->xndt2o = (float) substr($line1, 33, 10); |
94 | 94 | |
95 | 95 | /* Satellite's Second Time Derivative */ |
96 | - $this->xndd6o = (float) (substr($line1, 44, 1) . '.' . substr($line1, 45, 5) . 'E' . substr($line1, 50, 2)); |
|
96 | + $this->xndd6o = (float) (substr($line1, 44, 1).'.'.substr($line1, 45, 5).'E'.substr($line1, 50, 2)); |
|
97 | 97 | |
98 | 98 | /* Satellite's bstar drag term |
99 | 99 | FIXME: How about buff[0] ???? |
100 | 100 | */ |
101 | - $this->bstar = (float) (substr($line1, 53, 1) . '.' . substr($line1, 54, 5) . 'E' . substr($line1, 59, 2)); |
|
101 | + $this->bstar = (float) (substr($line1, 53, 1).'.'.substr($line1, 54, 5).'E'.substr($line1, 59, 2)); |
|
102 | 102 | |
103 | 103 | /* Element Number */ |
104 | 104 | $this->elset = (int) substr($line1, 64, 4); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->xnodeo = (float) substr($line2, 17, 8); |
112 | 112 | |
113 | 113 | /* Satellite's Orbital Eccentricity */ |
114 | - $this->eo = (float) ('.' . substr($line2, 26, 7)); |
|
114 | + $this->eo = (float) ('.'.substr($line2, 26, 7)); |
|
115 | 115 | |
116 | 116 | /* Satellite's Argument of Perigee (degrees) */ |
117 | 117 | $this->omegao = (float) substr($line2, 34, 8); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | for ($i = 0; $i < 68; $i++) { |
146 | 146 | if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) { |
147 | 147 | $value = $tle_set[$i] - '0'; |
148 | - } else if ($tle_set[$i] == '-' ) { |
|
148 | + } else if ($tle_set[$i] == '-') { |
|
149 | 149 | $value = 1; |
150 | 150 | } else { |
151 | 151 | $value = 0; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | for ($i = 0; $i < 68; $i++) { |
217 | 217 | if (($line[$i] >= '0') && ($line[$i] <= '9')) { |
218 | 218 | $value = (int) $line[$i]; |
219 | - } else if ($line[$i] == '-' ) { |
|
219 | + } else if ($line[$i] == '-') { |
|
220 | 220 | $value = 1; |
221 | 221 | } else { |
222 | 222 | $value = 0; |
@@ -7,14 +7,14 @@ |
||
7 | 7 | */ |
8 | 8 | class Predict_QTH |
9 | 9 | { |
10 | - public $name; /*!< Name, eg. callsign. */ |
|
11 | - public $loc; /*!< Location, eg City, Country. */ |
|
12 | - public $desc; /*!< Short description. */ |
|
13 | - public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | - public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | - public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | - public $qra; /*!< QRA locator */ |
|
17 | - public $wx; /*!< Weather station code (4 chars). */ |
|
10 | + public $name; /*!< Name, eg. callsign. */ |
|
11 | + public $loc; /*!< Location, eg City, Country. */ |
|
12 | + public $desc; /*!< Short description. */ |
|
13 | + public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | + public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | + public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | + public $qra; /*!< QRA locator */ |
|
17 | + public $wx; /*!< Weather station code (4 chars). */ |
|
18 | 18 | |
19 | - public $data; /*!< Raw data from cfg file. */ |
|
19 | + public $data; /*!< Raw data from cfg file. */ |
|
20 | 20 | } |
@@ -29,42 +29,42 @@ discard block |
||
29 | 29 | public $nickname = null; |
30 | 30 | public $website = null; |
31 | 31 | |
32 | - public $tle = null; /*!< Keplerian elements */ |
|
33 | - public $flags = 0; /*!< Flags for algo ctrl */ |
|
32 | + public $tle = null; /*!< Keplerian elements */ |
|
33 | + public $flags = 0; /*!< Flags for algo ctrl */ |
|
34 | 34 | public $sgps = null; |
35 | 35 | public $dps = null; |
36 | 36 | public $deep_arg = null; |
37 | - public $pos = null; /*!< Raw position and range */ |
|
38 | - public $vel = null; /*!< Raw velocity */ |
|
37 | + public $pos = null; /*!< Raw position and range */ |
|
38 | + public $vel = null; /*!< Raw velocity */ |
|
39 | 39 | |
40 | 40 | /*** FIXME: REMOVE */ |
41 | - public $bearing = null; /*!< Az, El, range and vel */ |
|
42 | - public $astro = null; /*!< Ra and Decl */ |
|
41 | + public $bearing = null; /*!< Az, El, range and vel */ |
|
42 | + public $astro = null; /*!< Ra and Decl */ |
|
43 | 43 | /*** END */ |
44 | 44 | |
45 | 45 | /* time keeping fields */ |
46 | 46 | public $jul_epoch = null; |
47 | 47 | public $jul_utc = null; |
48 | 48 | public $tsince = null; |
49 | - public $aos = null; /*!< Next AOS. */ |
|
50 | - public $los = null; /*!< Next LOS */ |
|
51 | - |
|
52 | - public $az = null; /*!< Azimuth [deg] */ |
|
53 | - public $el = null; /*!< Elevation [deg] */ |
|
54 | - public $range = null; /*!< Range [km] */ |
|
55 | - public $range_rate = null; /*!< Range Rate [km/sec] */ |
|
56 | - public $ra = null; /*!< Right Ascension [deg] */ |
|
57 | - public $dec = null; /*!< Declination [deg] */ |
|
58 | - public $ssplat = null; /*!< SSP latitude [deg] */ |
|
59 | - public $ssplon = null; /*!< SSP longitude [deg] */ |
|
60 | - public $alt = null; /*!< altitude [km] */ |
|
61 | - public $velo = null; /*!< velocity [km/s] */ |
|
62 | - public $ma = null; /*!< mean anomaly */ |
|
63 | - public $footprint = null; /*!< footprint */ |
|
64 | - public $phase = null; /*!< orbit phase */ |
|
65 | - public $meanmo = null; /*!< mean motion kept in rev/day */ |
|
66 | - public $orbit = null; /*!< orbit number */ |
|
67 | - public $otype = null; /*!< orbit type. */ |
|
49 | + public $aos = null; /*!< Next AOS. */ |
|
50 | + public $los = null; /*!< Next LOS */ |
|
51 | + |
|
52 | + public $az = null; /*!< Azimuth [deg] */ |
|
53 | + public $el = null; /*!< Elevation [deg] */ |
|
54 | + public $range = null; /*!< Range [km] */ |
|
55 | + public $range_rate = null; /*!< Range Rate [km/sec] */ |
|
56 | + public $ra = null; /*!< Right Ascension [deg] */ |
|
57 | + public $dec = null; /*!< Declination [deg] */ |
|
58 | + public $ssplat = null; /*!< SSP latitude [deg] */ |
|
59 | + public $ssplon = null; /*!< SSP longitude [deg] */ |
|
60 | + public $alt = null; /*!< altitude [km] */ |
|
61 | + public $velo = null; /*!< velocity [km/s] */ |
|
62 | + public $ma = null; /*!< mean anomaly */ |
|
63 | + public $footprint = null; /*!< footprint */ |
|
64 | + public $phase = null; /*!< orbit phase */ |
|
65 | + public $meanmo = null; /*!< mean motion kept in rev/day */ |
|
66 | + public $orbit = null; /*!< orbit number */ |
|
67 | + public $otype = null; /*!< orbit type. */ |
|
68 | 68 | |
69 | 69 | public function __construct(Predict_TLE $tle) |
70 | 70 | { |
@@ -93,30 +93,30 @@ discard block |
||
93 | 93 | $this->tle->omegao *= Predict::de2ra; |
94 | 94 | $this->tle->xmo *= Predict::de2ra; |
95 | 95 | $this->tle->xincl *= Predict::de2ra; |
96 | - $temp = Predict::twopi / Predict::xmnpda / Predict::xmnpda; |
|
96 | + $temp = Predict::twopi/Predict::xmnpda/Predict::xmnpda; |
|
97 | 97 | |
98 | 98 | /* store mean motion before conversion */ |
99 | 99 | $this->meanmo = $this->tle->xno; |
100 | - $this->tle->xno = $this->tle->xno * $temp * Predict::xmnpda; |
|
100 | + $this->tle->xno = $this->tle->xno*$temp*Predict::xmnpda; |
|
101 | 101 | $this->tle->xndt2o *= $temp; |
102 | - $this->tle->xndd6o = $this->tle->xndd6o * $temp / Predict::xmnpda; |
|
102 | + $this->tle->xndd6o = $this->tle->xndd6o*$temp/Predict::xmnpda; |
|
103 | 103 | $this->tle->bstar /= Predict::ae; |
104 | 104 | |
105 | 105 | /* Period > 225 minutes is deep space */ |
106 | - $dd1 = Predict::xke / $this->tle->xno; |
|
106 | + $dd1 = Predict::xke/$this->tle->xno; |
|
107 | 107 | $dd2 = Predict::tothrd; |
108 | 108 | $a1 = pow($dd1, $dd2); |
109 | 109 | $r1 = cos($this->tle->xincl); |
110 | - $dd1 = 1.0 - $this->tle->eo * $this->tle->eo; |
|
111 | - $temp = Predict::ck2 * 1.5 * ($r1 * $r1 * 3.0 - 1.0) / pow($dd1, 1.5); |
|
112 | - $del1 = $temp / ($a1 * $a1); |
|
113 | - $ao = $a1 * (1.0 - $del1 * (Predict::tothrd * 0.5 + $del1 * |
|
114 | - ($del1 * 1.654320987654321 + 1.0))); |
|
115 | - $delo = $temp / ($ao * $ao); |
|
116 | - $xnodp = $this->tle->xno / ($delo + 1.0); |
|
110 | + $dd1 = 1.0 - $this->tle->eo*$this->tle->eo; |
|
111 | + $temp = Predict::ck2*1.5*($r1*$r1*3.0 - 1.0)/pow($dd1, 1.5); |
|
112 | + $del1 = $temp/($a1*$a1); |
|
113 | + $ao = $a1*(1.0 - $del1*(Predict::tothrd*0.5 + $del1* |
|
114 | + ($del1*1.654320987654321 + 1.0))); |
|
115 | + $delo = $temp/($ao*$ao); |
|
116 | + $xnodp = $this->tle->xno/($delo + 1.0); |
|
117 | 117 | |
118 | 118 | /* Select a deep-space/near-earth ephemeris */ |
119 | - if (Predict::twopi / $xnodp / Predict::xmnpda >= .15625) { |
|
119 | + if (Predict::twopi/$xnodp/Predict::xmnpda >= .15625) { |
|
120 | 120 | $this->flags |= Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG; |
121 | 121 | } else { |
122 | 122 | $this->flags &= ~Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG; |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | |
143 | 143 | /* initialise observer location */ |
144 | 144 | if ($qth != null) { |
145 | - $obs_geodetic->lon = $qth->lon * Predict::de2ra; |
|
146 | - $obs_geodetic->lat = $qth->lat * Predict::de2ra; |
|
147 | - $obs_geodetic->alt = $qth->alt / 1000.0; |
|
145 | + $obs_geodetic->lon = $qth->lon*Predict::de2ra; |
|
146 | + $obs_geodetic->lat = $qth->lat*Predict::de2ra; |
|
147 | + $obs_geodetic->alt = $qth->alt/1000.0; |
|
148 | 148 | $obs_geodetic->theta = 0; |
149 | 149 | } |
150 | 150 | else { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | /* execute computations */ |
158 | 158 | $sdpsgp = Predict_SGPSDP::getInstance($sat); |
159 | - if ($sat->flags & Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG) { |
|
159 | + if ($sat->flags&Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG) { |
|
160 | 160 | $sdpsgp->SDP4($sat, 0.0); |
161 | 161 | } else { |
162 | 162 | $sdpsgp->SGP4($sat, 0.0); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | Predict_Math::Convert_Sat_State($sat->pos, $sat->vel); |
167 | 167 | |
168 | 168 | /* get the velocity of the satellite */ |
169 | - $sat->vel->w = sqrt($sat->vel->x * $sat->vel->x + $sat->vel->y * $sat->vel->y + $sat->vel->z * $sat->vel->z); |
|
169 | + $sat->vel->w = sqrt($sat->vel->x*$sat->vel->x + $sat->vel->y*$sat->vel->y + $sat->vel->z*$sat->vel->z); |
|
170 | 170 | $sat->velo = $sat->vel->w; |
171 | 171 | Predict_SGPObs::Calculate_Obs($jul_utc, $sat->pos, $sat->vel, $obs_geodetic, $obs_set); |
172 | 172 | Predict_SGPObs::Calculate_LatLonAlt($jul_utc, $sat->pos, $sat_geodetic); |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | $sat->ssplon = Predict_Math::Degrees($sat_geodetic->lon); |
188 | 188 | $sat->alt = $sat_geodetic->alt; |
189 | 189 | $sat->ma = Predict_Math::Degrees($sat->phase); |
190 | - $sat->ma *= 256.0 / 360.0; |
|
191 | - $sat->footprint = 2.0 * Predict::xkmper * acos (Predict::xkmper/$sat->pos->w); |
|
190 | + $sat->ma *= 256.0/360.0; |
|
191 | + $sat->footprint = 2.0*Predict::xkmper*acos(Predict::xkmper/$sat->pos->w); |
|
192 | 192 | $age = 0.0; |
193 | - $sat->orbit = floor(($sat->tle->xno * Predict::xmnpda / Predict::twopi + |
|
194 | - $age * $sat->tle->bstar * Predict::ae) * $age + |
|
195 | - $sat->tle->xmo / Predict::twopi) + $sat->tle->revnum - 1; |
|
193 | + $sat->orbit = floor(($sat->tle->xno*Predict::xmnpda/Predict::twopi + |
|
194 | + $age*$sat->tle->bstar*Predict::ae)*$age + |
|
195 | + $sat->tle->xmo/Predict::twopi) + $sat->tle->revnum - 1; |
|
196 | 196 | |
197 | 197 | /* orbit type */ |
198 | 198 | $sat->otype = $sat->get_orbit_type($sat); |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | It is time dependent. Also sat->jul_utc is often zero |
257 | 257 | when this function is called |
258 | 258 | ***/ |
259 | - if ((10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda))) == 0) { |
|
259 | + if ((10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda))) == 0) { |
|
260 | 260 | return true; |
261 | - } elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo) / |
|
262 | - (10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda)))) < $sat->jul_utc) { |
|
261 | + } elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo)/ |
|
262 | + (10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda)))) < $sat->jul_utc) { |
|
263 | 263 | return true; |
264 | 264 | } else { |
265 | 265 | return false; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $observerGeo = new Predict_Geodetic(); |
299 | 299 | $observerGeo->lat = Predict_Math::Radians($qth->lat); |
300 | 300 | $observerGeo->lon = Predict_Math::Radians($qth->lon); |
301 | - $observerGeo->alt = $qth->alt * 1000; |
|
301 | + $observerGeo->alt = $qth->alt*1000; |
|
302 | 302 | |
303 | 303 | // Now determine the sun and observer positions |
304 | 304 | $observerPos = new Predict_Vector(); |
@@ -311,12 +311,12 @@ discard block |
||
311 | 311 | $observerSatPos = new Predict_Vector(); |
312 | 312 | Predict_Math::Vec_Sub($this->pos, $observerPos, $observerSatPos); |
313 | 313 | $phaseAngle = Predict_Math::Degrees(Predict_Math::Angle($solarVector, $observerSatPos)); |
314 | - $illum = $phaseAngle / 180; |
|
314 | + $illum = $phaseAngle/180; |
|
315 | 315 | |
316 | - $illuminationChange = $illum / $imag['illum']; |
|
317 | - $inverseSquareOfDistanceChange = pow(($imag['distance'] / $this->range), 2); |
|
316 | + $illuminationChange = $illum/$imag['illum']; |
|
317 | + $inverseSquareOfDistanceChange = pow(($imag['distance']/$this->range), 2); |
|
318 | 318 | $changeInMagnitude = log( |
319 | - $illuminationChange * $inverseSquareOfDistanceChange, |
|
319 | + $illuminationChange*$inverseSquareOfDistanceChange, |
|
320 | 320 | self::POGSONS_RATIO |
321 | 321 | ); |
322 | 322 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | /* Modification to support Y2K */ |
44 | 44 | /* Valid 1957 through 2056 */ |
45 | - $day = self::modf($epoch * 1E-3, $year) * 1E3; |
|
45 | + $day = self::modf($epoch*1E-3, $year)*1E3; |
|
46 | 46 | if ($year < 57) { |
47 | 47 | $year = $year + 2000; |
48 | 48 | } else { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | /* Equivalent to the C modf function */ |
57 | 57 | public static function modf($x, &$ipart) { |
58 | - $ipart = (int)$x; |
|
58 | + $ipart = (int) $x; |
|
59 | 59 | return $x - $ipart; |
60 | 60 | } |
61 | 61 | |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | /* Astronomical Formulae for Calculators, Jean Meeus, */ |
69 | 69 | /* pages 23-25. Calculate Julian Date of 0.0 Jan year */ |
70 | 70 | $year = $year - 1; |
71 | - $i = (int) ($year / 100); |
|
71 | + $i = (int) ($year/100); |
|
72 | 72 | $A = $i; |
73 | - $i = (int) ($A / 4); |
|
73 | + $i = (int) ($A/4); |
|
74 | 74 | $B = (int) (2 - $A + $i); |
75 | - $i = (int) (365.25 * $year); |
|
76 | - $i += (int) (30.6001 * 14); |
|
75 | + $i = (int) (365.25*$year); |
|
76 | + $i += (int) (30.6001*14); |
|
77 | 77 | $jdoy = $i + 1720994.5 + $B; |
78 | 78 | |
79 | 79 | return $jdoy; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | /* Modification to support Y2K */ |
94 | 94 | /* Valid 1957 through 2056 */ |
95 | 95 | $year = 0; |
96 | - $day = self::modf($epoch * 1E-3, $year) * 1E3; |
|
96 | + $day = self::modf($epoch*1E-3, $year)*1E3; |
|
97 | 97 | |
98 | 98 | if ($year < 57) { |
99 | 99 | $year += 2000; |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | |
105 | 105 | $UT = fmod($day, $day); |
106 | 106 | $jd = self::Julian_Date_of_Year($year) + $day; |
107 | - $TU = ($jd - 2451545.0) / 36525; |
|
108 | - $GMST = 24110.54841 + $TU * (8640184.812866 + $TU * (0.093104 - $TU * 6.2E-6)); |
|
109 | - $GMST = Predict_Math::Modulus($GMST + Predict::secday * Predict::omega_E * $UT, Predict::secday); |
|
107 | + $TU = ($jd - 2451545.0)/36525; |
|
108 | + $GMST = 24110.54841 + $TU*(8640184.812866 + $TU*(0.093104 - $TU*6.2E-6)); |
|
109 | + $GMST = Predict_Math::Modulus($GMST + Predict::secday*Predict::omega_E*$UT, Predict::secday); |
|
110 | 110 | $deep_arg->ds50 = $jd - 2433281.5 + $UT; |
111 | 111 | |
112 | - return Predict_Math::FMod2p(6.3003880987 * $deep_arg->ds50 + 1.72944494); |
|
112 | + return Predict_Math::FMod2p(6.3003880987*$deep_arg->ds50 + 1.72944494); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /* See the ThetaG doc block above */ |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | /* Reference: The 1992 Astronomical Almanac, page B6. */ |
119 | 119 | $UT = Predict_Math::Frac($jd + 0.5); |
120 | 120 | $jd = $jd - $UT; |
121 | - $TU = ($jd - 2451545.0) / 36525; |
|
122 | - $GMST = 24110.54841 + $TU * (8640184.812866 + $TU * (0.093104 - $TU * 6.2E-6)); |
|
123 | - $GMST = Predict_Math::Modulus($GMST + Predict::secday * Predict::omega_E * $UT, Predict::secday); |
|
121 | + $TU = ($jd - 2451545.0)/36525; |
|
122 | + $GMST = 24110.54841 + $TU*(8640184.812866 + $TU*(0.093104 - $TU*6.2E-6)); |
|
123 | + $GMST = Predict_Math::Modulus($GMST + Predict::secday*Predict::omega_E*$UT, Predict::secday); |
|
124 | 124 | |
125 | - return Predict::twopi * $GMST / Predict::secday; |
|
125 | + return Predict::twopi*$GMST/Predict::secday; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public static function unix2daynum($sec, $usec = 0) |
150 | 150 | { |
151 | - $time = ((($sec + $usec) / 86400.0) - 3651.0); |
|
151 | + $time = ((($sec + $usec)/86400.0) - 3651.0); |
|
152 | 152 | return $time + 2444238.5; |
153 | 153 | } |
154 | 154 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | /* Values determined using data from 1950-1991 in the 1990 |
163 | 163 | Astronomical Almanac. See DELTA_ET.WQ1 for details. */ |
164 | 164 | |
165 | - $delta_et = 26.465 + 0.747622 * ($year - 1950) + |
|
166 | - 1.886913 * sin(Predict::twopi * ($year - 1975) / 33); |
|
165 | + $delta_et = 26.465 + 0.747622*($year - 1950) + |
|
166 | + 1.886913*sin(Predict::twopi*($year - 1975)/33); |
|
167 | 167 | |
168 | 168 | return $delta_et; |
169 | 169 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public static function daynum2unix($dn) { |
179 | 179 | // Converts a daynum to a UNIX timestamp |
180 | 180 | |
181 | - return (86400.0 * ($dn - 2444238.5 + 3651.0)); |
|
181 | + return (86400.0*($dn - 2444238.5 + 3651.0)); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | public static function daynum2readable($dn, $zone = 'America/Los_Angeles', $format = 'm-d-Y H:i:s') |
194 | 194 | { |
195 | 195 | $unix = self::daynum2unix($dn); |
196 | - $date = new DateTime("@" . round($unix)); |
|
196 | + $date = new DateTime("@".round($unix)); |
|
197 | 197 | $dateTimezone = new DateTimezone($zone); |
198 | 198 | $date->setTimezone($dateTimezone); |
199 | 199 | return $date->format($format); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | { |
211 | 211 | $year = $tle->epoch_year; |
212 | 212 | $day = $tle->epoch_day; |
213 | - $sec = round(86400 * $tle->epoch_fod); |
|
213 | + $sec = round(86400*$tle->epoch_fod); |
|
214 | 214 | |
215 | 215 | $zone = new DateTimeZone('GMT'); |
216 | 216 | $date = new DateTime(); |
@@ -218,6 +218,6 @@ discard block |
||
218 | 218 | $date->setDate($year, 1, 1); |
219 | 219 | $date->setTime(0, 0, 0); |
220 | 220 | |
221 | - return $date->format('U') + (86400 * $day) + $sec - 86400; |
|
221 | + return $date->format('U') + (86400*$day) + $sec - 86400; |
|
222 | 222 | } |
223 | 223 | } |