@@ -29,6 +29,10 @@ const tleStr = `ISS (ZARYA)
29
29
1 25544U 98067A 17206.51418347 .00001345 00000-0 27503-4 0 9993
30
30
2 25544 51.6396 207.2711 0006223 72.3525 71.7719 15.54224686 67715` ;
31
31
32
+ const proxima2 = `PROXIMA II
33
+ 1 43696U 18088G 21129.25183023 .00001100 00000-0 45012-4 0 9990
34
+ 2 43696 85.0353 221.2351 0019671 158.2001 202.0083 15.22857070138409` ;
35
+
32
36
const tleArr = tleStr . split ( "\n" ) ;
33
37
34
38
describe ( "getSatelliteInfo" , ( ) => {
@@ -190,8 +194,22 @@ describe("getGroundTracks", () => {
190
194
const firstLng = coords [ 0 ] [ 0 ] [ 0 ] ;
191
195
const lastLng = coords [ 0 ] [ coords [ 0 ] . length - 1 ] [ 0 ] ;
192
196
193
- expect ( firstLng ) . toBe ( - 179.95882804237493 ) ;
194
- expect ( lastLng ) . toBe ( 179.96378140395484 ) ;
197
+ expect ( firstLng ) . toBe ( - 179.9996305056871 ) ;
198
+ expect ( lastLng ) . toBe ( 179.9939688862288 ) ;
199
+ } ) ;
200
+
201
+ test ( "2" , async ( ) => {
202
+ const timestamp = 1620583838732 ;
203
+ const result = await getGroundTracks ( {
204
+ tle : proxima2 ,
205
+ startTimeMS : timestamp
206
+ } ) ;
207
+ expect ( result [ 0 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.65354 ) ;
208
+ expect ( result [ 0 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 84.57353 ) ;
209
+ expect ( result [ 1 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.68200 ) ;
210
+ expect ( result [ 1 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 85.06215 ) ;
211
+ expect ( result [ 2 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.89417 ) ;
212
+ expect ( result [ 2 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 84.63849 ) ;
195
213
} ) ;
196
214
} ) ;
197
215
@@ -209,8 +227,22 @@ describe("getGroundTracksSync", () => {
209
227
210
228
const firstLng = coords [ 0 ] [ 0 ] [ 0 ] ;
211
229
const lastLng = coords [ 0 ] [ coords [ 0 ] . length - 1 ] [ 0 ] ;
212
- expect ( firstLng ) . toBe ( - 179.95882804237493 ) ;
213
- expect ( lastLng ) . toBe ( 179.96378140395484 ) ;
230
+ expect ( firstLng ) . toBe ( - 179.9996305056871 ) ;
231
+ expect ( lastLng ) . toBe ( 179.9939688862288 ) ;
232
+ } ) ;
233
+
234
+ test ( "2" , async ( ) => {
235
+ const timestamp = 1620583838732 ;
236
+ const result = await getGroundTracksSync ( {
237
+ tle : proxima2 ,
238
+ optionalTimeMS : timestamp
239
+ } ) ;
240
+ expect ( result [ 0 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.65354 ) ;
241
+ expect ( result [ 0 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 84.57353 ) ;
242
+ expect ( result [ 1 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.68200 ) ;
243
+ expect ( result [ 1 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 85.06215 ) ;
244
+ expect ( result [ 2 ] [ 0 ] [ 0 ] ) . toBeCloseTo ( - 179.89417 ) ;
245
+ expect ( result [ 2 ] [ 0 ] [ 1 ] ) . toBeCloseTo ( 84.63849 ) ;
214
246
} ) ;
215
247
} ) ;
216
248
@@ -236,6 +268,20 @@ describe("problematic TLES (geosync, decayed)", () => {
236
268
expect ( result ) . toEqual ( expectedResult ) ;
237
269
} ) ;
238
270
271
+ test ( "getLastAntemeridianCrossingTimeMS 2" , ( ) => {
272
+ const timestamp = 1620579956208 ;
273
+ const result = getLastAntemeridianCrossingTimeMS ( proxima2 , timestamp ) ;
274
+ const expectedResult = - 1 ;
275
+ expect ( ( timestamp - result ) / 1000 / 60 ) . toBeCloseTo ( 72.50 ) ;
276
+ } ) ;
277
+
278
+ test ( "getLastAntemeridianCrossingTimeMS 3" , ( ) => {
279
+ const timestamp = 1620581856788 ;
280
+ const result = getLastAntemeridianCrossingTimeMS ( proxima2 , timestamp ) ;
281
+ const expectedResult = - 1 ;
282
+ expect ( ( timestamp - result ) / 1000 / 60 ) . toBeCloseTo ( 8.976 ) ;
283
+ } ) ;
284
+
239
285
test ( "getOrbitTrack" , async ( ) => {
240
286
const timestamp = 1501039265000 ;
241
287
const result = await getOrbitTrack ( {
0 commit comments