Working Examples
Every page in this section embeds a runnable script from the examples/ directory of the repository. The code you see is the code that runs: the pages import the scripts directly, so they cannot drift out of sync with the library.
Running the examples
The example scripts import from 'ootk' exactly like consumer code would. Inside the repository this resolves to the built dist/ output through npm package self-reference, so build once, then run any example with tsx:
bash
git clone https://github.com/thkruz/ootk.git
cd ootk
npm install
npm run build
npx tsx ./examples/satellite-passes.tsIndex
| Example | Demonstrates |
|---|---|
| Orbital Elements | Classical elements from TLEs, element/state-vector conversions, TLEs from elements |
| Coordinate Transforms | ECI/ECEF/LLA, J2000/TEME/ITRF state vectors, RIC/Hill relative frames, RAE/SEZ |
| Time Systems | UTC/TAI/TT/TDB/GPS epochs, Julian dates, GMST |
| Satellite Passes | Pass prediction, look angles, field-of-view checks |
| Sensors | Ground sensor math: RAE, ECEF/ECI transforms |
| Observations | RADEC formats, topocentric vs geocentric, state vectors from observations |
| Doppler Shift | Frequency shifts during a pass, Doppler corrections |
| Numerical Integrators | RK4/RK89 propagation with force models |
| Initial Orbit Determination | Lambert, Gibbs, and Herrick-Gibbs IOD from position fixes |
| Gooding IOD | Angles-only IOD from optical observations |
| Lambert State Vectors | State vectors without TLEs, transfer planning, multi-rev solutions |
| Maneuvers | Hohmann and two-burn transfers, delta-V budgets |
| Conjunction Assessment | High-fidelity conjunction screening with probability of collision |
| Covariance Matrix | RIC-frame covariance from TLE history |
| Sun | Sunrise/sunset and solar event times |
| Moon | Lunar position, rise/set, phase, and illumination |