ootk 1.6.0 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/thkruz/ootk/actions?query=workflow%3ACI)  [](https://www.npmjs.com/package/ootk) [](https://github.com/thkruz/ootk/issues) [](https://codecov.io/gh/thkruz/ootk) [](LICENSE.MD)
|
|
4
4
|
|
|
5
|
-
> An Orbital Object
|
|
5
|
+
> An Orbital Object Toolkit in Your Web Browser
|
|
6
6
|
|
|
7
7
|
**ootk** is a modular collection of small libraries for doing math related to orbital objects written in TypeScript. ootk was developed to simplify the math and let you focus on using the results.
|
|
8
8
|
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
- [Installation](#Installation)
|
|
12
12
|
- [Usage](#Usage)
|
|
13
|
+
- [Loading the Library](#Loading-the-Library)
|
|
14
|
+
- [Propagating a TLE](#Propagating-a-TLE)
|
|
15
|
+
- [Creating a Satellite](#Creating-a-Satellite)
|
|
16
|
+
- [Creating a Sensor](#Creating-a-Sensor)
|
|
13
17
|
- [Contributing](#Contributing)
|
|
14
18
|
- [Building](#Building)
|
|
15
19
|
- [Contributors](#Contributors)
|
|
@@ -25,7 +29,9 @@ npm i ootk
|
|
|
25
29
|
|
|
26
30
|
## :satellite: Usage
|
|
27
31
|
|
|
28
|
-
###
|
|
32
|
+
### Loading the Library
|
|
33
|
+
|
|
34
|
+
#### Common.js ([Node.js](https://nodejs.org))
|
|
29
35
|
|
|
30
36
|
```js
|
|
31
37
|
let Ootk = require('ootk.js');
|
|
@@ -33,7 +39,7 @@ let Ootk = require('ootk.js');
|
|
|
33
39
|
const satrec = Ootk.Sgp4.createSatrec(line1, line2, 'wgs72', 'i');
|
|
34
40
|
```
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
#### ES ([Babel.js](https://babeljs.io/))
|
|
37
43
|
|
|
38
44
|
```js
|
|
39
45
|
import * as Ootk from 'ootk.es.js';
|
|
@@ -41,7 +47,7 @@ import * as Ootk from 'ootk.es.js';
|
|
|
41
47
|
const satrec = Ootk.Sgp4.createSatrec(line1, line2, 'wgs72', 'i');
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
#### Script tag
|
|
45
51
|
|
|
46
52
|
Include `dist/ootk.js` as a script in your html:
|
|
47
53
|
|
|
@@ -55,6 +61,50 @@ Include `dist/ootk.js` as a script in your html:
|
|
|
55
61
|
var satrec = Ootk.Sgp4.createSatrec(line1, line2, 'wgs72', 'i');
|
|
56
62
|
```
|
|
57
63
|
|
|
64
|
+
### Propagating a TLE
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
const satrec = Ootk.Sgp4.createSatrec(line1, line2);
|
|
68
|
+
const state = Ootk.Sgp4.propagate(satrec, time);
|
|
69
|
+
console.log(state.position); // [x, y, z]
|
|
70
|
+
console.log(state.velocity); // [vx, vy, vz]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Creating a Satellite
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
const sat = new Ootk.Sat({ name: 'Test', tle1, tle2 });
|
|
77
|
+
console.log(sat.intlDes); // International Designator
|
|
78
|
+
console.log(sat.epochYear); // Epoch Year
|
|
79
|
+
console.log(sat.epochDay); // Epoch Day
|
|
80
|
+
console.log(sat.meanMoDev1); // Mean Motion Deviation 1
|
|
81
|
+
console.log(sat.meanMoDev2); // Mean Motion Deviation 2
|
|
82
|
+
console.log(sat.bstar); // Bstar (Drag Coefficient)
|
|
83
|
+
console.log(sat.inclination); // inclination in degrees
|
|
84
|
+
console.log(sat.raan); // right ascension of the ascending node in degrees
|
|
85
|
+
console.log(sat.eccentricity); // eccentricity
|
|
86
|
+
console.log(sat.argOfPerigee); // argument of perigee in degrees
|
|
87
|
+
console.log(sat.meanAnomaly); // mean anomaly in degrees
|
|
88
|
+
console.log(sat.meanMotion); // mean motion in revolutions per day
|
|
89
|
+
console.log(sat.period); // period in seconds
|
|
90
|
+
console.log(sat.apogee); // apogee in kilometers
|
|
91
|
+
console.log(sat.perigee); // perigee in kilometers
|
|
92
|
+
|
|
93
|
+
sat.propagate(time); // Propagate the satellite to the given time
|
|
94
|
+
sat.getLla(); // Get the satellite's position in latitude, longitude, altitude at its current time
|
|
95
|
+
sat.getEci(time); // Get the satellite's position in Earth-Centered Inertial coordinates at the given time without changing its state
|
|
96
|
+
sat.getRae(sensor, time); // Get position in range, aziimuth, elevation relative to a sensor object at the given time without changing its state
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Creating a Sensor
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
const sensor = new Ootk.Sensor({ name: 'Test', lat: lat, lon: lon, alt: alt });
|
|
103
|
+
sensor.setTime(time); // Set the sensor's time to the given time
|
|
104
|
+
sensor.getRae(sat); // Get satellite position in range, aziimuth, elevation at the sensor's current time
|
|
105
|
+
sensor.getRae(sat, time); // Get position in range, aziimuth, elevation relative to a satellite object at the given time without changing its state
|
|
106
|
+
```
|
|
107
|
+
|
|
58
108
|
## :desktop_computer: Building
|
|
59
109
|
|
|
60
110
|
The source code is organized as Common.js modules and uses [ES6 syntax](http://es6-features.org/). To build the library:
|