← All packages

Frames & geometry

star-coords 0.1.0

Spherical and cylindrical ⇄ rectangular coordinates

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

Apache-2.0 Released & Verified single file

Summary

Spherical and cylindrical coordinates to rectangular and back; agrees with ERFA, SPICE and astropy to 3e-16 relative and 6e-14 deg on 600 cases in both directions, close to the axis included, and refuses out-of-range input.

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 48 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_coords-0.1.0-py3-none-any.whl

In Python: import star_coords

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_coords_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-coords}: Spherical and cylindrical ⇄ rectangular coordinates},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_coords/},
  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-coords @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_coords"

README · tests · evidence (GitHub)

Technical sheet

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

Requirements

  • R1 spherical_to_xyz(lon, lat, r) and xyz_to_spherical(x, y, z) follow x = r cos(lat) cos(lon), y = r cos(lat) sin(lon), z = r sin(lat); longitude out in [0, 360), latitude from the arc-tangent (accurate at the poles), length without intermediate overflow or underflow.
  • R2 cylindrical_to_xyz(rho, lon, z) and xyz_to_cylindrical(x, y, z): x = rho cos(lon), y = rho sin(lon).
  • R3 Measured on 600 cases (100 directions down to 1e-9 deg from the z axis, lengths from 1e-3 to 1e9), in both directions: components and lengths within 3e-16 relative and angles within 6e-14 deg of displacement of ERFA, SPICE and astropy (spherical) and of SPICE and astropy (cylindrical).
  • R4 Every function returns finite floats or raises ValueError: non-numeric, boolean, NaN or infinite input, longitude outside [-360, 360], latitude outside [-90, 90], a negative radius, a length or component above 1e300. On the z axis the longitude is undefined and returned as 0.

Limits (what is not claimed)

Geocentric (spherical) latitude, not geodetic: for the ellipsoid use star_geodesy. No velocities. Colatitude conventions (physics spherical coordinates) are not offered: latitude is from the xy plane.

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_coords.py 0.944 (2026-10-06)
Independent implementations written by others (needs 2)
astropy spherical_to_cartesian / cartesian_to_spherical / CylindricalRepresentation, ERFA s2p / p2s (C), SPICE latrec / reclat / cylrec / reccyl (C)
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Unit testsVERIFIED2026-10-0648 passed in 0.41s
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-06(1.0000000000000002, 1.7320508075688772, 0.0): within 3e-16 of the exact value (suite: 48 passed in 0.41s)
Cross-check with independent librariesVERIFIED2026-10-06star_coords converts spherical and cylindrical coordinates to rectangular and back as three independent libraries do, close to the axis included
BenchmarkVERIFIED2026-10-06largest difference by lineage: erfa: 1.4e-14; spice: 5.6e-14; astropy: 5.6e-14
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 48 passed in 0.28s

Fingerprints (SHA-256)

star_coords-0.1.0-py3-none-any.whlf7a0c85613d3781f46418371f99f795bdaa424330b54a5bf361eb88cc5b1101c
star_coords.py80c6c016a17f7b4d2066eb5eba4708ccae6f151333e346a052f990b1249b80d0
star_coords-0.1.0-source.zipbae774a4db5a932e7c9121bf9cf7d11ec44e7919e13bc604a03bbce6440976e4

results