← All packages

Frames & geometry

star-mat3 0.1.0

The 3×3 matrix operations of frame and attitude code

Public state: Released & Verified. The registry label is RELEASED. What the states mean →

Apache-2.0 Released & Verified single file

Summary

Transpose, exact determinant and inverse, products and a proper-rotation test for 3x3 matrices; determinant and inverse identical to exact rational arithmetic on 575 matrices including condition numbers up to 1e8 (where SPICE's inverse is off by 6e-6 and NumPy's by 9e-10); singular matrices refused.

Run in your browser

Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).

Runs in the browser: all 22 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.

Use it on your computer

No account and no GitHub needed. Download, then install with one command:

python -m pip install star_mat3-0.1.0-py3-none-any.whl

In Python: import star_mat3

Get started →

Cite it, and its bill of materials

For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.

@software{cavazzini_star_mat3_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-mat3}: The 3×3 matrix operations of frame and attitude code},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_mat3/},
  note    = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}

For developers

Install directly from the public repository:

python -m pip install "star-mat3 @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_mat3"

README · tests · evidence (GitHub)

Technical sheet

Package
star-mat3
Import name
star_mat3
Version
0.1.0
Licence
Apache-2.0
Python
>=3.9
Dependencies
none (standard library only)
Capability
star.geometry.mat3
Maturity
Released & Verified (RELEASED)
Published commit
dc09f61d

Requirements

  • R1 determinant and inverse in exact rational arithmetic (a float is an exact fraction), rounded once: correct to the last digit whatever the conditioning. inverse refuses singular and nearly singular matrices, with a test that does not depend on the scale of the entries.
  • R2 transpose, matmul, matvec, identity; is_rotation(m, tol) is True only for an orthonormal matrix with determinant +1 within the tolerance.
  • R3 Measured on 575 matrices (300 general, 150 rotations, 125 with condition numbers up to 1e8) against EXACT arithmetic (SymPy): determinant and inverse identical to the exact value rounded; products within 4e-15. On the ill-conditioned matrices SPICE's inverse differs from the exact one by up to 6e-6 of its largest entry and NumPy's by 9e-10. is_rotation agrees with SPICE on every matrix.
  • R4 Every function returns floats (or a bool) or raises ValueError: wrong shape or type, an entry that is not a finite real number within ±1e60 (booleans refused), a singular or nearly singular matrix, an inverse that overflows, a tolerance outside (0, 1].

Limits (what is not claimed)

3×3 only; no eigenvalues, no decompositions, no orthonormalisation of a drifting rotation. The exact arithmetic makes inverse slower than a floating-point one (tens of microseconds): it is for correctness, not for inner loops. "Exact" means the exact inverse of the floats given: if those floats are themselves rounded measurements of an ill-conditioned matrix, the inverse amplifies their error by the condition number, and nothing here can prevent that. The products are compensated sums of rounded products, accurate to a few units in the last place, not exact.

Release gate

Computed by the registry from the result files, with the same function that decides RELEASED.

Mutation score, latest measure of each module (needs at least 0.850)
  • star_mat3.py 0.941 (2026-10-06)
Independent implementations written by others (needs 2)
NumPy linalg det / inv and @, SPICE det / invert / mxm / mxv / xpose / isrot (C), SymPy exact rational matrices
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 22 passed in 0.11s
Unit testsVERIFIED2026-10-0622 passed in 0.35s
ReviewVERIFIED2026-10-06Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-06Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-06determinant 3.0 and the inverse exactly as the correctly rounded fractions (suite: 22 passed in 0.35s)
Cross-check with independent librariesVERIFIED2026-10-06star_mat3 computes determinant, inverse and products of 3x3 matrices to the accuracy double precision allows, as measured against exact arithmetic, and recognises rotations as SPICE does
BenchmarkVERIFIED2026-10-06inverse of ill-conditioned matrices against the exact one: star_mat3 0.0e+00; and star_mat3 against SPICE 6.3e-06, NumPy 8.7e-10

Fingerprints (SHA-256)

star_mat3-0.1.0-py3-none-any.whla43dbc5fa62c9d9b1aa023375a145d98369a5931eb96cf09e8cef87dce772acd
star_mat3.py40456aa4d4da89cd6b1aaeca81e93b57e971b8cf672d9b34c005a5eb5b5ee343
star_mat3-0.1.0-source.zip9fc3da18de452e73ae8d0600fdee4ee7fc071bf66a6b125cfd9f26ed6d5ff3d9

results