ootk
Version:
Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.
171 lines (170 loc) • 6.65 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 { Vector3D, Vector, Radians } from '../main.js';
/**
* A matrix is a rectangular array of numbers or other mathematical objects for
* which operations such as addition and multiplication are defined.
*/
export declare class Matrix {
elements: number[][];
readonly rows: number;
readonly columns: number;
constructor(elements: number[][]);
/**
* Creates a matrix with all elements set to zero.
* @param rows - The number of rows in the matrix.
* @param columns - The number of columns in the matrix.
* @returns A matrix with all elements set to zero.
*/
static allZeros(rows: number, columns: number): Matrix;
/**
* Creates a new Matrix with the specified number of rows and columns, filled
* with the specified value.
* @param rows The number of rows in the matrix.
* @param columns The number of columns in the matrix.
* @param value The value to fill the matrix with. Default is 0.0.
* @returns A new Matrix filled with the specified value.
*/
static fill(rows: number, columns: number, value?: number): Matrix;
/**
* Creates a rotation matrix around the X-axis.
* @param theta - The angle of rotation in radians.
* @returns The rotation matrix.
*/
static rotX(theta: Radians): Matrix;
/**
* Creates a rotation matrix around the y-axis.
* @param theta - The angle of rotation in radians.
* @returns The rotation matrix.
*/
static rotY(theta: Radians): Matrix;
/**
* Creates a rotation matrix around the Z-axis.
* @param theta The angle of rotation in radians.
* @returns The rotation matrix.
*/
static rotZ(theta: Radians): Matrix;
/**
* Creates a zero matrix with the specified number of rows and columns.
* @param rows The number of rows in the matrix.
* @param columns The number of columns in the matrix.
* @returns A new Matrix object representing the zero matrix.
*/
static zero(rows: number, columns: number): Matrix;
/**
* Creates an identity matrix of the specified dimension.
* @param dimension The dimension of the identity matrix.
* @returns The identity matrix.
*/
static identity(dimension: number): Matrix;
/**
* Creates a diagonal matrix with the given diagonal elements.
* @param d - An array of diagonal elements.
* @returns A new Matrix object representing the diagonal matrix.
*/
static diagonal(d: number[]): Matrix;
/**
* Adds the elements of another matrix to this matrix and returns the result.
* @param m - The matrix to be added.
* @returns The resulting matrix after addition.
*/
add(m: Matrix): Matrix;
/**
* Subtracts the elements of another matrix from this matrix.
* @param m - The matrix to subtract.
* @returns A new matrix containing the result of the subtraction.
*/
subtract(m: Matrix): Matrix;
/**
* Scales the matrix by multiplying each element by a scalar value.
* @param n - The scalar value to multiply each element by.
* @returns A new Matrix object representing the scaled matrix.
*/
scale(n: number): Matrix;
/**
* Negates the matrix by scaling it by -1.
* @returns The negated matrix.
*/
negate(): Matrix;
/**
* Multiplies this matrix with another matrix.
* @param m The matrix to multiply with.
* @returns The resulting matrix.
*/
multiply(m: Matrix): Matrix;
/**
* Computes the outer product of this matrix with another matrix.
* @param m - The matrix to compute the outer product with.
* @returns The resulting matrix.
*/
outerProduct(m: Matrix): Matrix;
/**
* Multiplies the matrix by a vector.
* @param v The vector to multiply by.
* @returns A new vector representing the result of the multiplication.
*/
multiplyVector(v: Vector): Vector;
/**
* Multiplies a 3D vector by the matrix.
* @template T - The type of the vector elements.
* @param v - The 3D vector to multiply.
* @returns The resulting 3D vector after multiplication.
*/
multiplyVector3D<T extends number>(v: Vector3D<T>): Vector3D<T>;
/**
* Returns a new Matrix object where each element is the reciprocal of the
* corresponding element in the current matrix. If an element in the current
* matrix is zero, the corresponding element in the output matrix will also be
* zero.
* @returns A new Matrix object representing the reciprocal of the current
* matrix.
*/
reciprocal(): Matrix;
/**
* Transposes the matrix by swapping rows with columns.
* @returns A new Matrix object representing the transposed matrix.
*/
transpose(): Matrix;
/**
* Performs the Cholesky decomposition on the matrix.
* @returns A new Matrix object representing the Cholesky decomposition of the
* original matrix.
*/
cholesky(): Matrix;
/**
* Swaps two rows in the matrix.
* @param i - The index of the first row.
* @param j - The index of the second row.
*/
private _swapRows;
/**
* Converts the matrix to reduced row echelon form using the Gaussian
* elimination method. This method modifies the matrix in-place.
*/
private toReducedRowEchelonForm_;
/**
* Calculates the inverse of the matrix.
* @returns The inverse of the matrix.
*/
inverse(): Matrix;
}