Orbis.Covariance (Orbis v0.9.0)

Copy Markdown View Source

Covariance matrix helpers for conjunction and orbit analysis.

Supports covariance extraction, frame transforms, scaling, combination, and validation checks such as positive semidefiniteness.

Summary

Functions

Add two 3x3 matrices.

Extract a 3x3 position covariance matrix from a 6-element lower triangle (RTN). Expected order: CR_R (0,0), CT_R (1,0), CT_T (1,1), CN_R (2,0), CN_T (2,1), CN_N (2,2).

Matrix multiplication (3x3).

Check if a 3x3 matrix is symmetric and positive semidefinite (PSD).

Transform a 3x3 RTN covariance matrix to ECI.

Scale a matrix by a scalar.

Check if a matrix is symmetric.

Transpose a 3x3 matrix.

Validate that the input is a 3x3 numeric matrix.

Types

mat3()

@type mat3() :: [[float()]]

vec3()

@type vec3() :: {float(), float(), float()}

Functions

add(a, b)

@spec add(mat3(), mat3()) :: mat3()

Add two 3x3 matrices.

extract_pos_cov(arg1)

@spec extract_pos_cov([float()]) :: {:ok, mat3()} | {:error, String.t()}

Extract a 3x3 position covariance matrix from a 6-element lower triangle (RTN). Expected order: CR_R (0,0), CT_R (1,0), CT_T (1,1), CN_R (2,0), CN_T (2,1), CN_N (2,2).

mat_mul(a, b)

@spec mat_mul(mat3(), mat3()) :: mat3()

Matrix multiplication (3x3).

positive_semidefinite?(m)

@spec positive_semidefinite?(mat3()) :: boolean()

Check if a 3x3 matrix is symmetric and positive semidefinite (PSD).

A symmetric 3x3 matrix is PSD if all its principal minors are non-negative.

rtn_to_eci(cov_rtn, r, v)

@spec rtn_to_eci(mat3(), vec3(), vec3()) :: {:ok, mat3()} | {:error, String.t()}

Transform a 3x3 RTN covariance matrix to ECI.

scale(m, s)

@spec scale(mat3(), float()) :: mat3()

Scale a matrix by a scalar.

symmetric?(m)

Check if a matrix is symmetric.

transpose(m)

@spec transpose(mat3()) :: mat3()

Transpose a 3x3 matrix.

valid_matrix?(m)

@spec valid_matrix?(any()) :: boolean()

Validate that the input is a 3x3 numeric matrix.