star-slerp 0.1.0
Interpolation of attitudes along the shortest arc
Public state: Released & Verified. The registry label is RELEASED. What the states mean →
Apache-2.0 Released & Verified single file
Summary
Spherical linear interpolation between unit quaternions along the shorter rotation, and interpolation in a table of attitudes at given times; on 600 pairs of attitudes the largest component difference is 4.4e-16 from SciPy Slerp and 3.3e-16 from a route through NAIF SPICE rotation matrices, axis and angle.
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 240 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_slerp-0.1.0-py3-none-any.whl 3 kB
- Single file — copy it alongside your code · star_slerp.py 5 kB
- Source code (.zip) 22 kB
python -m pip install star_slerp-0.1.0-py3-none-any.whlIn Python: import star_slerp
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_slerp_0_1_0,
author = {Cavazzini, Andrea},
title = {{star-slerp}: Interpolation of attitudes along the shortest arc},
version = {0.1.0},
year = {2026},
url = {https://andrea07072000.github.io/S.T.A.R.-/software/star_slerp/},
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-slerp @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_slerp"
Technical sheet
Requirements
- R1
slerp(q0, q1, t)returns the attitude reached after the fraction t of the rotation from q0 to q1, about the same axis and at constant rate; quaternions are (w, x, y, z), scalar first, of unit length. - R2 The path is always the shorter rotation: when q0 and q1 are in opposite hemispheres q1 is negated first. The result is of unit length and in the hemisphere of q0.
interpolate(times, quaternions, t)applies the same rule between the two rows of the table that bracket t and refuses a t outside the table. - R3 Measured on 600 pairs of attitudes (rotations from 1e-9 rad to within 0.1 degree of 180 degrees, either hemisphere): the largest component difference is 4.4e-16 from SciPy
Slerp, 3.3e-16 from a route through NAIF SPICE rotation matrices, axis and angle, and 2.2e-16 from ahrs above its linear-interpolation threshold. - R4 Every function returns a tuple of four floats or raises
ValueError: a quaternion that is not four finite numbers of unit length within 1e-9 (never normalised silently), t out of range, a malformed or non-increasing table.
Limits (what is not claimed)
Interpolation at constant rate between two attitudes, nothing else: no angular velocity, no smooth (C1) interpolation across table rows (the rate jumps at each row), no extrapolation, no model of the true motion between samples. For a rotation of exactly 180 degrees both arcs are equally short and the result follows the sign of the q1 supplied; other libraries may choose the other arc. The quaternion convention is scalar-first Hamilton: data in another convention must be converted before use.
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_slerp.py 0.971 (2026-10-07)
- Independent implementations written by others (needs 2)
- ahrs.common.quaternion.slerp, NAIF SPICE through rotation matrices, axis and angle, scipy.spatial.transform.Slerp
- Result
- Released & Verified
Evidence in the registry
| Check | Status | Recorded | What was observed |
|---|---|---|---|
| Clean install from the release tag | VERIFIED | 2026-10-07 | pytest outside the tree: 240 passed in 0.56s |
| Unit tests | VERIFIED | 2026-10-07 | 240 passed in 0.82s |
| Review | VERIFIED | 2026-10-07 | Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed |
| Review | VERIFIED | 2026-10-07 | Re-running the cross-check gives a byte-identical evidence file |
| Reference value | VERIFIED | 2026-10-07 | slerp((1, 0, 0, 0), (cos 45 deg, 0, 0, sin 45 deg), 0.5) = (0.9238795325112866, 0.0, 0.0, 0.3826834323650897) (suite: 240 passed in 0.82s) |
| Cross-check with independent libraries | VERIFIED | 2026-10-07 | star_slerp interpolates two attitudes along the shorter rotation at constant rate and returns a unit quaternion |
| Benchmark | VERIFIED | 2026-10-07 | largest component difference from SciPy Slerp: 4.4e-16 |
Fingerprints (SHA-256)
| star_slerp-0.1.0-py3-none-any.whl | 353e85479c65a707360afd00a744af905bf46be7314d0cafe391b8736cd5b06c |
| star_slerp.py | 74c8063585c8506e6ebd51060392d9af2b18fc5f83ef5be6d28a689efaabb6be |
| star_slerp-0.1.0-source.zip | c89998d768e2a837831d713f5cba1f6c30f2b848f9d5fb41120abb7647b116eb |
