- Timestamp:
- Jan 16, 2010, 10:39:37 AM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnctime.cpp
r2123 r2251 8 8 9 9 using namespace std; 10 11 double djul(long jj, long mm, double tt) { 12 long ii, kk; 13 double djul ; 14 if( mm <= 2 ) { 15 jj = jj - 1; 16 mm = mm + 12; 17 } 18 ii = jj/100; 19 kk = 2 - ii + ii/4; 20 djul = (365.25*jj - fmod( 365.25*jj, 1.0 )) - 679006.0; 21 djul = djul + floor( 30.6001*(mm + 1) ) + tt + kk; 22 return djul; 23 } 10 24 11 25 // Constructor … … 174 188 } 175 189 190 191 // 192 ////////////////////////////////////////////////////////////////////////////// 193 bncTime& bncTime::set(int year, int month, int day, 194 int hour, int min, double sec) { 195 return set(year, month, day, hour*3600 + min*60 + sec); 196 } 197 198 // 199 ////////////////////////////////////////////////////////////////////////////// 200 bncTime& bncTime::set(int year, int month, int day, double daysec) { 201 _sec = daysec; 202 203 _mjd = (unsigned int)djul(year, month, day); 204 205 while ( _sec >= 86400 ) { 206 _sec-=86400; 207 _mjd++; 208 } 209 while ( _sec < 0 ) { 210 _sec+=86400; 211 _mjd--; 212 } 213 214 return *this; 215 } -
trunk/BNC/bnctime.h
r2177 r2251 11 11 12 12 bncTime& set(int gpsw, double gpssec); 13 bncTime& set(int year, int month, int day, int hour, int min, double sec); 14 bncTime& set(int year, int month, int day, double daysec); 13 15 14 16 unsigned int mjd() const;
Note:
See TracChangeset
for help on using the changeset viewer.