ootk
Version:
Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.
133 lines (132 loc) • 5.23 kB
TypeScript
/**
* @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 { Minutes, PositionVelocity, Degrees, Kilometers, Radians } from '../main.js';
import { EpochUTC } from '../time/EpochUTC.js';
import { EquinoctialElements } from './EquinoctialElements.js';
import { OrbitRegime } from '../enums/OrbitRegime.js';
import { StateVector } from './StateVector.js';
import { ClassicalElementsParams } from '../interfaces/ClassicalElementsParams.js';
/**
* The ClassicalElements class represents the classical orbital elements of an object.
* @example
* ```ts
* const epoch = EpochUTC.fromDateTime(new Date('2024-01-14T14:39:39.914Z'));
* const elements = new ClassicalElements({
* epoch,
* semimajorAxis: 6943.547853722985 as Kilometers,
* eccentricity: 0.0011235968124658146,
* inclination: 0.7509087232045765 as Radians,
* rightAscension: 0.028239555738616327 as Radians,
* argPerigee: 2.5386411901807353 as Radians,
* trueAnomaly: 0.5931399364974058 as Radians,
* });
* ```
*/
export declare class ClassicalElements {
epoch: EpochUTC;
semimajorAxis: Kilometers;
eccentricity: number;
inclination: Radians;
rightAscension: Radians;
argPerigee: Radians;
trueAnomaly: Radians;
/** Gravitational parameter in km³/s². */
mu: number;
constructor({ epoch, semimajorAxis, eccentricity, inclination, rightAscension, argPerigee, trueAnomaly, mu, }: ClassicalElementsParams);
/**
* Creates a new instance of ClassicalElements from a StateVector.
* @param state The StateVector to convert.
* @param mu The gravitational parameter of the central body. Default value is Earth's gravitational parameter.
* @returns A new instance of ClassicalElements.
* @throws Error if the StateVector is not in an inertial frame.
*/
static fromStateVector(state: StateVector, mu?: number): ClassicalElements;
/**
* Gets the inclination in degrees.
* @returns The inclination in degrees.
*/
get inclinationDegrees(): Degrees;
/**
* Gets the right ascension in degrees.
* @returns The right ascension in degrees.
*/
get rightAscensionDegrees(): Degrees;
/**
* Gets the argument of perigee in degrees.
* @returns The argument of perigee in degrees.
*/
get argPerigeeDegrees(): Degrees;
/**
* Gets the true anomaly in degrees.
* @returns The true anomaly in degrees.
*/
get trueAnomalyDegrees(): Degrees;
/**
* Gets the apogee of the classical elements. It is measured from the surface of the earth.
* @returns The apogee in kilometers.
*/
get apogee(): Kilometers;
/**
* Gets the perigee of the classical elements. The perigee is the point in an
* orbit that is closest to the surface of the earth.
* @returns The perigee distance in kilometers.
*/
get perigee(): number;
toString(): string;
/**
* Calculates the mean motion of the celestial object.
* @returns The mean motion in radians.
*/
get meanMotion(): Radians;
/**
* Calculates the period of the orbit.
* @returns The period in seconds.
*/
get period(): Minutes;
/**
* Compute the number of revolutions completed per day for this orbit.
* @returns The number of revolutions per day.
*/
get revsPerDay(): number;
/**
* Returns the orbit regime based on the classical elements.
* @returns The orbit regime.
*/
getOrbitRegime(): OrbitRegime;
/**
* Converts the classical orbital elements to position and velocity vectors.
* @returns An object containing the position and velocity vectors.
*/
toPositionVelocity(): PositionVelocity;
/**
* Converts the classical elements to equinoctial elements.
* @returns The equinoctial elements.
*/
toEquinoctialElements(): EquinoctialElements;
/**
* Propagates the classical elements to a given epoch.
* @param propEpoch - The epoch to propagate the classical elements to.
* @returns The classical elements at the propagated epoch.
*/
propagate(propEpoch: EpochUTC): ClassicalElements;
}