star-quaternion 0.1.0
Rotations with one stated convention
Public state: Released & Verified. The registry label is RELEASED. What the states mean →
Apache-2.0 Released & Verified single file
Summary
Unit quaternion algebra, rotation matrices and axis-angle with a fixed, tested convention (scalar first, Hamilton, active rotation); agrees with NAIF SPICE and SciPy to 9e-16 and refuses non-unit quaternions and non-rotation matrices instead of normalising them silently.
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 37 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:
- Install file · star_quaternion-0.1.0-py3-none-any.whl 4 kB
- Single file — copy it alongside your code · star_quaternion.py 8 kB
- Source code (.zip) 20 kB
python -m pip install star_quaternion-0.1.0-py3-none-any.whlIn Python: import star_quaternion
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_quaternion_0_1_0,
author = {Cavazzini, Andrea},
title = {{star-quaternion}: Rotations with one stated convention},
version = {0.1.0},
year = {2026},
url = {https://andrea07072000.github.io/S.T.A.R.-/software/star_quaternion/},
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-quaternion @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_quaternion"
Technical sheet
Requirements
- R1 Convention: quaternion (w, x, y, z) with the scalar first, Hamilton product, ACTIVE rotation;
to_dcm(q)is the matrix R withrotate(q, v) = R v;multiply(a, b)applies b first, then a. This is the convention of NAIF SPICE (q2m,m2q,qxq); SciPy stores the scalar last. - R2
normalize,conjugate,multiply,rotate,to_dcm,from_dcm,from_axis_angle,to_axis_angle,angle_between_deg.from_dcmuses the largest-component method (exact on half-turns, where the trace method divides by zero) and returns the quaternion with w >= 0. Angles are computed with atan2: a rotation of 1e-12 degrees keeps its value. - R3 Measured against SPICE and SciPy on 411 cases (random rotations, identity, half-turns, 1e-9 degree rotations): matrix, matrix-to-quaternion, product, rotated vector and angle agree within 9e-16.
- R4 Every function returns finite floats or raises
ValueError: wrong shape, non-numeric, boolean, NaN, infinite or |value| >= 1e150 input; a zero quaternion or axis; a quaternion whose norm is further than 1e-6 from 1 where a unit quaternion is required (it is refused, not silently normalised); a matrix that is not orthonormal to 1e-9 or is a reflection.
Limits (what is not claimed)
No Euler angles (twelve conventions: a separate, explicit interface is needed), no interpolation, no attitude determination. Frames are the caller's: the functions rotate vectors, they do not know what the frames are called.
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_quaternion.py 0.958 (2026-10-06)
- Independent implementations written by others (needs 2)
- NAIF CSPICE q2m, m2q, qxq, mxv, raxisa, SciPy Rotation (scalar-last quaternion)
- Also compared with, not counted
- S.T.A.R.'s own re-derivations: hand-computed quarter turns and Hamilton relations
- Result
- Released & Verified
Evidence in the registry
| Check | Status | Recorded | What was observed |
|---|---|---|---|
| Clean install from the release tag | VERIFIED | 2026-10-06 | pytest outside the tree: 37 passed in 0.22s |
| Unit tests | VERIFIED | 2026-10-06 | 37 passed in 0.45s |
| Review | VERIFIED | 2026-10-06 | Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed |
| Review | VERIFIED | 2026-10-06 | Re-running the cross-check gives a byte-identical evidence file |
| Reference value | VERIFIED | 2026-10-06 | quarter turns about the three axes, the matrix of the +Z quarter turn and the Hamilton relations reproduced to 1e-12; SPICE q2m, m2q, qxq agree on 411 cases to 9e-16 (suite: 37 passed in 0.45s) |
| Cross-check with independent libraries | VERIFIED | 2026-10-06 | star_quaternion agrees with two independent rotation libraries and fixes one convention |
| Benchmark | VERIFIED | 2026-10-06 | max absolute difference by operation: dcm 8.9e-16, quat_from_dcm 3.3e-16, product 4.4e-16, rotated_vector_relative 6.4e-16, angle_rad 8.9e-16 |
Fingerprints (SHA-256)
| star_quaternion-0.1.0-py3-none-any.whl | c66e06142eacc3ad6ba850d472d43bda045b63fc3a9a8f337447f2d3ec0b6910 |
| star_quaternion.py | df2c68812a8624679517765a7f2647c84156f28bd6ff20137699a75be2dcdc78 |
| star_quaternion-0.1.0-source.zip | f7f47443a67aa906716f65caad256d4b785659065251fff643af71acae9df99e |
