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.

124 lines (123 loc) 6.19 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. */ import { Degrees, DegreesPerSecond, Kilometers, KilometersPerSecond, Radians, RadiansPerSecond } from '../main.js'; import { J2000 } from '../coordinate/J2000.js'; import { AngularDistanceMethod } from '../enums/AngularDistanceMethod.js'; import { Vector3D } from '../operations/Vector3D.js'; import { EpochUTC } from '../time/EpochUTC.js'; /** * Represents a topocentric right ascension and declination observation. * * Topocentric coordinates take into account the observer's exact location on the Earth's surface. This model is crucial * for precise measurements of local astronomical events and nearby celestial objects, where the observer's latitude, * longitude, and altitude can significantly affect the observed position due to parallax. Topocentric coordinates are * particularly important for observations of the Moon, planets, and artificial satellites. */ export declare class RadecTopocentric { epoch: EpochUTC; rightAscension: Radians; declination: Radians; range?: Kilometers; rightAscensionRate?: RadiansPerSecond | null; declinationRate?: RadiansPerSecond | null; rangeRate?: KilometersPerSecond | null; constructor(epoch: EpochUTC, rightAscension: Radians, declination: Radians, range?: Kilometers, rightAscensionRate?: RadiansPerSecond | null, declinationRate?: RadiansPerSecond | null, rangeRate?: KilometersPerSecond | null); /** * Create a new RadecTopocentric object, using degrees for the angular values. * @param epoch UTC epoch. * @param rightAscensionDegrees Right-ascension in degrees. * @param declinationDegrees Declination in degrees. * @param range Range in km. * @param rightAscensionRateDegrees Right-ascension rate in degrees per second. * @param declinationRateDegrees Declination rate in degrees per second. * @param rangeRate Range rate in km/s. * @returns A new RadecTopocentric object. */ static fromDegrees(epoch: EpochUTC, rightAscensionDegrees: Degrees, declinationDegrees: Degrees, range?: Kilometers, rightAscensionRateDegrees?: DegreesPerSecond, declinationRateDegrees?: DegreesPerSecond, rangeRate?: KilometersPerSecond): RadecTopocentric; /** * Create a new RadecTopocentric object from a J2000 state vector. * @param state Inertial state vector. * @param site Site vector. * @returns A new RadecTopocentric object. */ static fromStateVector(state: J2000, site: J2000): RadecTopocentric; /** * Gets the right ascension in degrees. * @returns The right ascension in degrees. */ get rightAscensionDegrees(): Degrees; /** * Gets the declination in degrees. * @returns The declination in degrees. */ get declinationDegrees(): Degrees; /** * Gets the right ascension rate in degrees per second. * @returns The right ascension rate in degrees per second, or null if it is not available. */ get rightAscensionRateDegrees(): DegreesPerSecond | null; /** * Gets the rate of change of declination in degrees per second. * @returns The rate of change of declination in degrees per second, or null if the declination rate is not defined. */ get declinationRateDegrees(): DegreesPerSecond | null; /** * Return the position relative to the observer site. * * An optional range value can be passed to override the value contained in this observation. * @param site Observer site. * @param range Range in km. * @returns A Vector3D object. */ position(site: J2000, range?: Kilometers): Vector3D<Kilometers>; /** * Return the velocity relative to the observer site. * * An optional range and rangeRate value can be passed to override the values contained in this observation. * @param site Observer site. * @param range Range in km. * @param rangeRate Range rate in km/s. * @returns A Vector3D object. */ velocity(site: J2000, range?: Kilometers, rangeRate?: KilometersPerSecond): Vector3D<KilometersPerSecond>; /** * Calculates the line of sight vector in the topocentric coordinate system. * The line of sight vector points from the observer's location towards the celestial object. * @returns The line of sight vector as a Vector3D object. */ lineOfSight(): Vector3D; /** * Calculate the angular distance between this and another RadecTopocentric object. * @param radec - The other RadecTopocentric object. * @param method - The angular distance method to use. * @returns The angular distance. */ angle(radec: RadecTopocentric, method?: AngularDistanceMethod): Radians; /** * Calculate the angular distance between this and another RadecTopocentric object. * @param radec - The other RadecTopocentric object. * @param method - The angular distance method to use. * @returns The angular distance */ angleDegrees(radec: RadecTopocentric, method?: AngularDistanceMethod): Degrees; }