← All packages

Frames & geometry

star-sphere 0.1.1

Angles between directions on the sphere

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

Apache-2.0 Released & Verified single file

Summary

Angular separation, position angle and offset point for directions on the sphere, accurate from 1e-12 deg to the antipode; agrees with ERFA and astropy to 3e-14 deg on 600 pairs and refuses out-of-range angles.

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 33 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026. Open it in the Workspace →

Use it on your computer

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

python -m pip install star_sphere-0.1.1-py3-none-any.whl

In Python: import star_sphere

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_sphere_0_1_1,
  author  = {Cavazzini, Andrea},
  title   = {{star-sphere}: Angles between directions on the sphere},
  version = {0.1.1},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_sphere/},
  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-sphere @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_sphere"

README · tests · evidence (GitHub)

Technical sheet

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

Requirements

  • R1 separation_deg in [0, 180] with the arc-tangent formula: nearby directions (1e-12 deg) and nearly antipodal ones keep their digits. Reproduces Meeus Example 17.a (32.7930 deg). Since 0.1.1 the differences of longitude and latitude are taken in degrees before any conversion, so a separation of 1e-12 deg is right to the last digits (0.1.0 was wrong in the sixth digit at 1e-9 deg and in the third at 1e-12 deg: update if you measure tiny angles).
  • R2 position_angle_deg in [0, 360), from North through East; offset(lon, lat, position_angle, distance) returns (longitude in [0, 360), latitude) and is the inverse of the two.
  • R3 Measured on 600 pairs (300 random, 150 down to 1e-6 deg apart, 150 down to 1e-6 deg from the antipode): separation within 6e-14 deg of ERFA and astropy, position angle within 1e-15 rad of displacement, offset points within 4e-13 deg of astropy.
  • R4 Every function returns finite floats in those ranges or raises ValueError: non-numeric, boolean, NaN or infinite input, latitude outside [-90, 90], longitude or position angle outside [-360, 360], distance outside [0, 180]. For coincident directions the position angle is undefined and returned as 0.

Limits (what is not claimed)

A sphere: for distances on the Earth's ellipsoid use star_geodesic (the difference reaches 0.5 %). No proper motion, aberration or refraction: the directions are taken as given.

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_sphere.py 0.880 (2026-10-07)
Independent implementations written by others (needs 2)
astropy angular_separation / position_angle / offset_by, ERFA seps / pas (C)
Also compared with, not counted
published values: Meeus, Astronomical Algorithms, Example 17.a
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Clean install from the release tagVERIFIED2026-10-07pytest outside the tree: 33 passed in 0.17s
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 32 passed in 0.55s
Unit testsVERIFIED2026-10-0632 passed in 0.55s
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-0632.79303 deg, within 2.7e-5 deg of the printed value (printed to 1e-4) (suite: 32 passed in 0.55s)
Cross-check with independent librariesVERIFIED2026-10-06star_sphere agrees with two independent implementations at every distance, nearby and nearly antipodal pairs included
BenchmarkVERIFIED2026-10-06largest differences by lineage: erfa: separation 2.8e-14 deg, position angle 0.0e+00 rad; astropy: separation 2.8e-14 deg, position angle 9.9e-16 rad

Fingerprints (SHA-256)

star_sphere-0.1.1-py3-none-any.whla51886a9b856625c7de68bd9dcf37be51ba5711fb147545f053ddae01fe7dbe3
star_sphere.py109d55b2ce7627f10b231c80276369061a59e12450ebbbef7507183668b9beb1
star_sphere-0.1.1-source.zip49953da198329b30d4a4debda5fd5257ea78ce0239d512326c3dc704d950d54e

results