UNPKG

ootk-core

Version:

Orbital Object Toolkit. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.

103 lines (102 loc) 3.87 kB
/** * @author Theodore Kruczek. * @license MIT * @copyright (c) 2022-2025 Theodore Kruczek Permission is * hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * @copyright (c) 2012–2016 Brandon Rhodes * This was ported from the python-sgp4 library by Brandon Rhodes. */ import { OmmParsedDataFormat } from '../interfaces/OmmFormat.js'; import { Sgp4OpsMode } from '../enums/Sgp4OpsMode.js'; import { GreenwichMeanSiderealTime, SatelliteRecord, StateVectorSgp4, Vec3Flat } from '../types/types.js'; export declare enum Sgp4GravConstants { wgs72old = "wgs72old", wgs72 = "wgs72", wgs84 = "wgs84" } export declare enum Sgp4Methods { NEAR_EARTH = "n", DEEP_SPACE = "d" } export declare class Sgp4 { private static angle_; private static asinh_; static createSatrec(tleLine1: string, tleLine2: string, whichconst?: Sgp4GravConstants, opsmode?: Sgp4OpsMode): SatelliteRecord; static createSatrecFromOmm(omm: OmmParsedDataFormat, whichconst?: Sgp4GravConstants, opsmode?: Sgp4OpsMode): SatelliteRecord; private static cross_; static days2mdhms(year: number, days: number): { mon: number; day: number; hr: number; min: number; sec: number; }; private static dot_; static gstime(jdut1: number): GreenwichMeanSiderealTime; static invjday(jd: number, jdfrac: number): { year: number; mon: number; day: number; hr: number; min: number; sec: number; }; static jday(year: number | Date, mon?: number, day?: number, hr?: number, min?: number, sec?: number, ms?: number): { jd: number; jdFrac: number; }; private static mag_; private static newtonnu_; static propagate(satrec: SatelliteRecord, tsince: number): StateVectorSgp4; static rv2coe(r: Vec3Flat, v: Vec3Flat, mus: number): { p: number; a: number; ecc: number; incl: number; omega: number; argp: number; nu: number; m: number; arglat: number; truelon: number; lonper: number; }; /** * Determines the sign of a given number. * @param x - The input number to evaluate. * @returns `-1.0` if the input number is less than `0.0`, otherwise `1.0`. */ private static sgn_; /** * Computes the hyperbolic sine of a given number. * * The hyperbolic sine is calculated using the formula: * sinh(x) = (e^x - e^(-x)) / 2 * @param x - The input number for which to calculate the hyperbolic sine. * @returns The hyperbolic sine of the input number. */ private static sinh_; private static dpper_; private static dscom_; private static dsinit_; private static dspace_; private static getgravconst_; private static initl_; private static sgp4init_; }