Skip to content

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.ts

Index

ExampleDemonstrates
Orbital ElementsClassical elements from TLEs, element/state-vector conversions, TLEs from elements
Coordinate TransformsECI/ECEF/LLA, J2000/TEME/ITRF state vectors, RIC/Hill relative frames, RAE/SEZ
Time SystemsUTC/TAI/TT/TDB/GPS epochs, Julian dates, GMST
Satellite PassesPass prediction, look angles, field-of-view checks
SensorsGround sensor math: RAE, ECEF/ECI transforms
ObservationsRADEC formats, topocentric vs geocentric, state vectors from observations
Doppler ShiftFrequency shifts during a pass, Doppler corrections
Numerical IntegratorsRK4/RK89 propagation with force models
Initial Orbit DeterminationLambert, Gibbs, and Herrick-Gibbs IOD from position fixes
Gooding IODAngles-only IOD from optical observations
Lambert State VectorsState vectors without TLEs, transfer planning, multi-rev solutions
ManeuversHohmann and two-burn transfers, delta-V budgets
Conjunction AssessmentHigh-fidelity conjunction screening with probability of collision
Covariance MatrixRIC-frame covariance from TLE history
SunSunrise/sunset and solar event times
MoonLunar position, rise/set, phase, and illumination

Released under the AGPL-3.0 License.