Skip to content

Commit

Permalink
Version 2.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
ezze committed Mar 1, 2018
2 parents 19d77ea + 226d8d5 commit 9ad2c75
Show file tree
Hide file tree
Showing 7 changed files with 264 additions and 281 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## Changelog

### 2.0.0
### 2.0.1 (2018-03-01)

- `sgp4` function's call result is used in `sgp4init`.
- Longitude of `eciToGeodetic` result is in [-PI; PI] range now.

### 2.0.0 (2017-12-23)

- Library became ES and Common.js compatible.
- Source code is reorganized to match [original Python library](https://pypi.python.org/pypi/sgp4/).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ npm run lint:test
```

Implementing new functions or features, please, if possible, provide tests to cover them and mention your works
in [Changelog](#CHANGELOG).
in [Changelog](CHANGELOG.md).

In order to get test code coverage run the following:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "satellite.js",
"version": "2.0.0",
"version": "2.0.1",
"description": "SGP4/SDP4 calculation library",
"main": "lib/index.js",
"jsnext:main": "dist/satellite.es.js",
Expand Down
9 changes: 5 additions & 4 deletions src/propagation/sgp4init.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,11 @@ export default function sgp4init(satrec, options) {
// sgp4fix take out check to let satellites process until they are actually below earth surface
// if(rec.error == 0)
}
sgp4(rec, 0.0);

rec.init = 'n';
const { satrec: resultRec } = sgp4(rec, 0.0);

// rec.error contains any error codes
return rec;
resultRec.init = 'n';

// resultRec.error contains any error codes
return resultRec;
}
11 changes: 10 additions & 1 deletion src/transforms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
pi,
twoPi,
rad2deg,
} from './constants';

Expand Down Expand Up @@ -52,7 +53,15 @@ export function eciToGeodetic(eciCoords, gmst) {
const R = Math.sqrt((eciCoords.x * eciCoords.x) + (eciCoords.y * eciCoords.y));
const f = (a - b) / a;
const e2 = ((2 * f) - (f * f));
const longitude = Math.atan2(eciCoords.y, eciCoords.x) - gmst;

let longitude = Math.atan2(eciCoords.y, eciCoords.x) - gmst;
while (longitude < -pi) {
longitude += twoPi;
}
while (longitude > pi) {
longitude -= twoPi;
}

const kmax = 20;
let k = 0;
let latitude = Math.atan2(
Expand Down
6 changes: 0 additions & 6 deletions test/.babelrc

This file was deleted.

Loading

0 comments on commit 9ad2c75

Please sign in to comment.