UNPKG

ootk

Version:

Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.

96 lines (95 loc) 4.8 kB
/** * @author @thkruz Theodore Kruczek * @description Orbital Object ToolKit (ootk) is a collection of tools for working * with satellites and other orbital objects. * @license AGPL-3.0-or-later * @copyright (c) 2025 Kruczek Labs LLC * * Many of the classes are based off of the work of @david-rc-dayton and his * Pious Squid library (https://github.com/david-rc-dayton/pious_squid) which * is licensed under the MIT license. * * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the * terms of the GNU Affero General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later version. * * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License along with * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>. */ import { StringifiedNumber, TleParams, TleLine1, TleLine2 } from '../main.js'; /** * A class containing static methods for formatting TLEs (Two-Line Elements). */ export declare abstract class FormatTle { private constructor(); /** * Creates a TLE (Two-Line Element) string based on the provided TleParams. * @param tleParams - The parameters used to generate the TLE. * @returns An object containing the TLE strings tle1 and tle2. */ static createTle(tleParams: TleParams): { tle1: TleLine1; tle2: TleLine2; }; /** * Converts the argument of perigee to a stringified number. * @param argPe - The argument of perigee to be converted. Can be either a number or a string. * @returns The argument of perigee as a stringified number. * @throws Error if the length of the argument of perigee is not 8. */ static argumentOfPerigee(argPe: number | string): StringifiedNumber; /** * Returns the eccentricity value of a given string. * @param ecen - The string representing the eccentricity. * @returns The eccentricity value. * @throws Error if the length of the eccentricity string is not 7. */ static eccentricity(ecen: string): string; /** * Converts the inclination value to a string representation. * @param inc - The inclination value to be converted. * @returns The string representation of the inclination value. * @throws Error if the length of the converted value is not 8. */ static inclination(inc: number | string): StringifiedNumber; /** * Converts the mean anomaly to a string representation with 8 digits, padded with leading zeros. * @param meana - The mean anomaly to be converted. Can be either a number or a string. * @returns The mean anomaly as a string with 8 digits, padded with leading zeros. * @throws Error if the length of the mean anomaly is not 8. */ static meanAnomaly(meana: number | string): StringifiedNumber; /** * Converts the mean motion value to a string representation with 8 decimal * places. If the input is a number, it is converted to a string. If the input * is already a string, it is parsed as a float and then converted to a string * with 8 decimal places. The resulting string is padded with leading zeros to * ensure a length of 11 characters. Throws an error if the resulting string * does not have a length of 11 characters. * @param meanmo - The mean motion value to be converted. * @returns The string representation of the mean motion value with 8 decimal * places and padded with leading zeros. * @throws Error if the resulting string does not have a length of 11 * characters. */ static meanMotion(meanmo: number | string): StringifiedNumber; /** * Converts the right ascension value to a stringified number. * @param rasc - The right ascension value to convert. * @returns The stringified number representation of the right ascension. * @throws Error if the length of the converted right ascension is not 8. */ static rightAscension(rasc: number | string): StringifiedNumber; /** * Sets a character at a specific index in a string. If the index is out of range, the original string is returned. * @param str - The input string. * @param index - The index at which to set the character. * @param chr - The character to set at the specified index. * @returns The modified string with the character set at the specified index. */ static setCharAt(str: string, index: number, chr: string): string; }