Skip to content

Commit

Permalink
docs: 📝 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 13, 2024
1 parent 8f29fcc commit 02f0922
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 48 deletions.
27 changes: 18 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.0.0-2](https://github.com/thkruz/ootk-core/compare/v1.0.0-1...v1.0.0-2)

- refactor: :recycle: implement strict checks in tsconfig [`b1515cb`](https://github.com/thkruz/ootk-core/commit/b1515cb07794b7ac465bf27ebfb48232140f2e25)
- feat: :sparkles: sync all commonjs es5 and typescript examples [`adb58fa`](https://github.com/thkruz/ootk-core/commit/adb58faf46de6af12568064d5941026a31942ecf)
- refactor: :recycle: standardize eci and rae methods [`5581a18`](https://github.com/thkruz/ootk-core/commit/5581a18ffcb7ebbc04365e36fe49b51534c99137)
- refactor: :recycle: implement strict checks in tsconfig
[`b1515cb`](https://github.com/thkruz/ootk-core/commit/b1515cb07794b7ac465bf27ebfb48232140f2e25)
- feat: :sparkles: sync all commonjs es6 and typescript examples
[`adb58fa`](https://github.com/thkruz/ootk-core/commit/adb58faf46de6af12568064d5941026a31942ecf)
- refactor: :recycle: standardize eci and rae methods
[`5581a18`](https://github.com/thkruz/ootk-core/commit/5581a18ffcb7ebbc04365e36fe49b51534c99137)

#### [v1.0.0-1](https://github.com/thkruz/ootk-core/compare/v1.0.0-0...v1.0.0-1)

> 12 January 2024
- refactor: :recycle: combine Tle classes and improve documentation [`b5b506a`](https://github.com/thkruz/ootk-core/commit/b5b506af622d673fbf03fa4edbb11b405f27099f)
- test: :white_check_mark: fix tests [`4c2d701`](https://github.com/thkruz/ootk-core/commit/4c2d701dfc25d04a3929956e0ff2d5f94466bd05)
- refactor: :recycle: move moon code to moon [`7f5d7c7`](https://github.com/thkruz/ootk-core/commit/7f5d7c74b41216e75b94fbb32b07c6303cf044ec)
- refactor: :recycle: combine Tle classes and improve documentation
[`b5b506a`](https://github.com/thkruz/ootk-core/commit/b5b506af622d673fbf03fa4edbb11b405f27099f)
- test: :white_check_mark: fix tests
[`4c2d701`](https://github.com/thkruz/ootk-core/commit/4c2d701dfc25d04a3929956e0ff2d5f94466bd05)
- refactor: :recycle: move moon code to moon
[`7f5d7c7`](https://github.com/thkruz/ootk-core/commit/7f5d7c74b41216e75b94fbb32b07c6303cf044ec)

#### v1.0.0-0

> 7 January 2024
- feat: :boom: initial commit [`9893a6a`](https://github.com/thkruz/ootk-core/commit/9893a6acfb5dd51b12d755518c3af120fecc28be)
- test: :truck: update names and paths [`c48aece`](https://github.com/thkruz/ootk-core/commit/c48aece9a4c8a328cc7778292c4397312c162982)
- fix: :white_check_mark: fix test paths [`b784f3e`](https://github.com/thkruz/ootk-core/commit/b784f3eab311661415bfc9aa4001d9d8b8acd19f)
- feat: :boom: initial commit
[`9893a6a`](https://github.com/thkruz/ootk-core/commit/9893a6acfb5dd51b12d755518c3af120fecc28be)
- test: :truck: update names and paths
[`c48aece`](https://github.com/thkruz/ootk-core/commit/c48aece9a4c8a328cc7778292c4397312c162982)
- fix: :white_check_mark: fix test paths
[`b784f3e`](https://github.com/thkruz/ootk-core/commit/b784f3eab311661415bfc9aa4001d9d8b8acd19f)
70 changes: 41 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# ootk
# ootk-core

<!-- [![Release](https://img.shields.io/github/v/release/thkruz/ootk-core?style=flat-square)](https://www.npmjs.com/package/ootk-core) -->

![Size](https://img.shields.io/github/languages/code-size/thkruz/ootk-core?style=flat-square)
[![Release](https://img.shields.io/github/v/release/thkruz/ootk-core?style=flat-square)](https://www.npmjs.com/package/ootk)
[![Issues](https://img.shields.io/github/issues/thkruz/ootk-core?style=flat-square)](https://github.com/thkruz/ootk/issues)
[![Coverage](https://img.shields.io/codecov/c/github/thkruz/ootk-core?style=flat-square)](https://codecov.io/gh/thkruz/ootk)
[![License](https://img.shields.io/github/license/thkruz/ootk-core?style=flat-square)](LICENSE.md)

> An Orbital Object Toolkit in Your Web Browser
**ootk-core** is the core libraries of [ootk](https://github.com/thkruz/ootk) for doing math related to orbital objects
written in TypeScript. **ootk-core** was developed to simplify the math and let you focus on using the results.
written in TypeScript and built for both CommonJS and ES6 JavaScript or TypeScript. **ootk-core** was developed to
simplify the math and let you focus on using the results. It is the culmination of years of fixes and improvements to
other libraries.

If you would like more functionality the expanded **ootk** library is available free under the AGPL license
[here](https://github.com/thkruz/ootk). The full library has features for doing initial orbit determination, maneuver
Expand Down Expand Up @@ -42,22 +44,38 @@ npm i ootk-core
### Loading the Library

```js
import { Sgp4 } from 'ootk-core';
import { Satellite } from 'ootk-core';
...
const satrec = Sgp4.createSatrec(line1, line2, 'wgs72', 'i');
const satellite = new Satellite({
tle1: line1,
tle2: line2
});
```

## :satellite: Usage

### Propagating a TLE

```js
import { Sgp4 } from 'ootk-core';

const satrec = Sgp4.createSatrec(line1, line2);
const state = Sgp4.propagate(satrec, time);
console.log(state.position); // [x, y, z]
console.log(state.velocity); // [vx, vy, vz]
import { Satellite } from 'ootk-core';
...
const satellite = new Satellite({
tle1: line1,
tle2: line2
});
const state = satellite.eci();
console.log(state.position);
// {
// x: 1538.223335842895
// y: 5102.261204021967
// z: 4432.634965003577
// }
console.log(state.velocity);
// {
// x: -4.26262363267920
// y: 0.159169020320195
// z: 1.502351885030190
// }
```

### Creating a Satellite
Expand All @@ -83,19 +101,18 @@ console.log(sat.period); // period in seconds
console.log(sat.apogee); // apogee in kilometers
console.log(sat.perigee); // perigee in kilometers

sat.propagate(time); // Propagate the satellite to the given time
sat.getLla(); // Get the satellite's position in latitude, longitude, altitude at its current time
sat.getEci(time); // Get the satellite's position in Earth-Centered Inertial coordinates at the given time without changing its state
sat.getRae(sensor, time); // Get position in range, aziimuth, elevation relative to a sensor object at the given time without changing its state
sat.lla(); // Get the satellite's position in latitude, longitude, altitude at its current time
sat.eci(time); // Get the satellite's position in Earth-Centered Inertial coordinates at the given time
sat.rae(sensor, time); // Get position in range, aziimuth, elevation relative to a sensor object at the given time
```

### Creating a Sensor

```js
const sensor = new Ootk.Sensor({ name: 'Test', lat: lat, lon: lon, alt: alt });
sensor.setTime(time); // Set the sensor's time to the given time
sensor.getRae(sat); // Get satellite position in range, aziimuth, elevation at the sensor's current time
sensor.getRae(sat, time); // Get position in range, aziimuth, elevation relative to a satellite object at the given time without changing its state
sensor.rae(sat); // Get satellite position in range, aziimuth, elevation at the sensor's current time
sensor.rae(sat, time); // Get position in range, aziimuth, elevation relative to a satellite object at the given time
sensor.eci() // Get the sensor's position in ECI coordinates
```

## :desktop_computer: Building
Expand All @@ -116,12 +133,9 @@ sensor.getRae(sat, time); // Get position in range, aziimuth, elevation relative

## :gem: NPM Scripts

- `build` compiles TypeScript into ES6 Modules and combines them into a single file in the `dist` directory.
- `build` compiles TypeScript into ES6 Modules in `lib` directory and CommonJs in `commonjs` directory
- `lint` lints source code located in `src` directory with [ESLint](http://eslint.org/)
- `lint:fix` lints tests located in `src` directory with ESLint and attempts to auto-fix errors
- `lint:test` lints tests located in `test` directory with ESLint
- `test` builds the software and then runs jest to verify the final library remains functional
- `test:coverage` generates lcov report to view code coverage

## :man_teacher: Contributing

Expand All @@ -137,17 +151,15 @@ git merge origin/develop
git checkout -b my-feature
```

Make sure that your changes don't break the existing code by running:
When you are done, make sure that your changes don't break the existing code by running:

```bash
npm test
```

Check that your code follows the rules established in eslint.rc:
After you have pushed your branch you can [create a pull request here](https://github.com/thkruz/ootk-core/pulls).

```bash
npm run lint
```
If you need help, just open an issue and I'll happily walk you through the process.

## :man_scientist: Contributors

Expand All @@ -164,6 +176,6 @@ the previous work of the following:

## :balance_scale: License

In order to maximize the usabiltiy of the core modules of OOTK with other projects I support, I have placed this
In order to maximize the usabiltiy of the core modules of ootk with other projects I support, I have placed this
repository under the [MIT License](LICENSE.md). I strongly encourage you to conisder a GPL license for your own project
to keep your project free for everyone to use. [Learn more here](https://www.gnu.org/philosophy/philosophy.html).
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Run the examples using tsx as below:

npx tsx ./examples/typescript/satellite-js-migration.ts

## ES5 Module
## ES6 Module

npx tsx ./examples/es5/satellite-js-migration.mjs
npx tsx ./examples/es6/satellite-js-migration.mjs

## CommonJs

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/body/Moon.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* Some of the math in this file was originally created by Vladimir Agafonkin.
Expand Down
2 changes: 1 addition & 1 deletion src/coordinate/TLE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The Tle module contains a collection of functions for working with TLEs.
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**

Check failure on line 1 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './coordinate/Tle' or its corresponding type declarations.
* @author @thkruz Theodore Kruczek
* @description Orbital Object ToolKit Core (OOTK-Core) is a base collection
* @description Orbital Object ToolKit Core (ootk-Core) is a base collection
* of tools for working with satellites and other orbital objects. This core
* library is provided under the MIT license and is free to use in any project.
* For additional features, see the full library at:
Expand Down
2 changes: 1 addition & 1 deletion src/objects/BaseObject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The BaseObject class is used for creating core properties and methods applicable
Expand Down
2 changes: 1 addition & 1 deletion src/objects/Satellite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**

Check failure on line 1 in src/objects/Satellite.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module '../coordinate/Tle' or its corresponding type declarations.
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The Satellite class provides functions for calculating satellites positions
Expand Down
2 changes: 1 addition & 1 deletion src/objects/Star.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The Star class is meant to help with cacluating star positions relative to
Expand Down
2 changes: 1 addition & 1 deletion src/sgp4/sgp4.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The Sgp4 module contains a TypeScript port of the 2020 version of
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/transforms.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable init-declarations */
/**
* @author Theodore Kruczek.
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
* with satellites and other orbital objects.
*
* @file The Transforms module contains a collection of conversions not contained
Expand Down

0 comments on commit 02f0922

Please sign in to comment.