ootk-core
Version:
Orbital Object Toolkit. A modern typed replacement for satellite.js including SGP4 propagation, TLE parsing, Sun and Moon calculations, and more.
87 lines (86 loc) • 3.49 kB
TypeScript
/**
* @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 { Kilometers, KilometersPerSecond, Radians } from '../main.js';
import { Matrix } from './Matrix.js';
import { Vector } from './Vector.js';
export declare class Vector3D<T extends number = number> {
x: T;
y: T;
z: T;
constructor(x: T, y: T, z: T);
/**
* Create a new Vector3D object from the first three elements of a Vector
* object.
* @param v The Vector object to convert.
* @returns A new Vector3D object.
*/
static fromVector<U extends number>(v: Vector<U>): Vector3D<U>;
static readonly origin: Vector3D<number>;
static readonly xAxis: Vector3D<number>;
static readonly yAxis: Vector3D<number>;
static readonly zAxis: Vector3D<number>;
static readonly xAxisNeg: Vector3D<number>;
static readonly yAxisNeg: Vector3D<number>;
static readonly zAxisNeg: Vector3D<number>;
toList(): T[];
toArray(): Float64Array<ArrayBuffer>;
/**
* Return the Vector3D element at the provided index.
* @deprecated don't do this
* @param index The index of the element to return.
* @returns The element at the provided index.
*/
getElement(index: number): number;
toVector(): Vector<T>;
toString(fixed?: number): string;
magnitude(): T;
add(v: Vector3D<T>): Vector3D<T>;
subtract(v: Vector3D<T>): Vector3D<T>;
scale<U extends number>(n: U): Vector3D<U>;
negate(): Vector3D<T>;
/**
* Return the Euclidean distance between this and another Vector3D.
* @param v The other Vector3D.
* @returns The distance between this and the other Vector3D.
*/
distance(v: Vector3D<T>): T;
/**
* Convert this to a unit Vector3D.
* @returns A unit Vector3D.
*/
normalize(): Vector3D<T>;
dot<T extends number>(v: Vector3D<T>): T;
outer(v: Vector3D): Matrix;
cross<U extends number>(v: Vector3D<U>): Vector3D<U>;
skewSymmetric(): Matrix;
rotX(theta: number): Vector3D;
rotY(theta: Radians): Vector3D<T>;
rotZ(theta: Radians): Vector3D<T>;
angle<U extends number>(v: Vector3D<U>): Radians;
angleDegrees(v: Vector3D<T>): number;
sight(v: Vector3D<KilometersPerSecond>, radius: Kilometers): boolean;
bisect(v: Vector3D<T>): Vector3D<T>;
row(): Matrix;
column(): Matrix;
join(v: Vector3D): Vector;
}