Changeset 804 in ntrip for trunk/BNS/bnsutils.cpp
- Timestamp:
- Apr 9, 2008, 12:50:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnsutils.cpp
r802 r804 94 94 } 95 95 96 // 96 // Satellite Position computed using broadcast ephemeris 97 97 //////////////////////////////////////////////////////////////////////////// 98 void satellitePosition( double GPSweeks, const gpsEph* ep,98 void satellitePosition(int GPSweek, double GPSweeks, const gpsEph* ep, 99 99 double& X, double& Y, double& Z, double& dt, 100 100 double& vX, double& vY, double& vZ) { 101 101 102 const static double secPerWeek = 7 * 86400.0; 102 103 const static double omegaEarth = 7292115.1467e-11; 103 104 const static double gmWGS = 398.6005e12; … … 112 113 double n0 = sqrt(gmWGS/(a0*a0*a0)); 113 114 double tk = GPSweeks - ep->TOE; 115 if (GPSweek != ep->GPSweek) { 116 tk += (GPSweek - ep->GPSweek) * secPerWeek; 117 } 114 118 double n = n0 + ep->Delta_n; 115 119 double M = ep->M0 + n*tk; … … 141 145 142 146 double tc = GPSweeks - ep->TOC; 147 if (GPSweek != ep->GPSweek) { 148 tc += (GPSweek - ep->GPSweek) * secPerWeek; 149 } 143 150 dt = ep->clock_bias + ep->clock_drift*tc + ep->clock_driftrate*tc*tc 144 151 - 4.442807633e-10 * ep->e * sqrt(a0) *sin(E); … … 168 175 vZ = sini *doty + yp*cosi *doti; 169 176 } 177 178 // Transformation xyz --> radial, along track, out-of-plane 179 //////////////////////////////////////////////////////////////////////////// 180 void XYZ_to_RSW(const ColumnVector& rr, const ColumnVector& vv, 181 const ColumnVector& xyz, ColumnVector& rsw) { 182 183 ColumnVector cross = crossproduct(rr, vv); 184 185 rsw.ReSize(3); 186 rsw(1) = DotProduct(xyz, rr) / rr.norm_Frobenius(); 187 rsw(2) = DotProduct(xyz, vv) / vv.norm_Frobenius(); 188 rsw(3) = DotProduct(xyz, cross) / cross.norm_Frobenius(); 189 }
Note:
See TracChangeset
for help on using the changeset viewer.