Skip to main content

Utilities for working with spherical geometry

Project description

spherical-tools

PyPI License

Convert between geographic, spherical, and Cartesian coordinates. This is a lightweight Python library designed for geoscientists working with coordinates on the sphere.


📦 Installation

Install from PyPI:

pip install spherical-tools

Or install the latest development version:

pip install git+https://github.com/tom-new/spherical-tools.git

🚀 Quick Start

import spherical_tools as st

# Convert from spherical (r, theta, phi) to Cartesian
# theta = azimuthal angle, phi = polar angle
x, y, z = st.sph2cart([1, 30, 60], degrees=True)

# convert from Cartesian to spherical
r, theta, phi = st.cart2sph([x, y, z], degrees=True)

By deafault, angles are in radians but input and output angles can be in degrees by setting degrees=True.


📚 Function Reference

  • sph2cart(r, theta, phi, degrees=False)
  • cart2sph(x, y, z, degrees=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spherical_tools-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spherical_tools-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file spherical_tools-0.1.1.tar.gz.

File metadata

  • Download URL: spherical_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for spherical_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 915389b2d0afd26700deb5046212893766e563e37b61a3c22f1026c302b6fdd5
MD5 12cf32ca60d0a303277e7ff6342ba0f4
BLAKE2b-256 c24c6f57b60cc47b07d558231fda83759606cc13a41b961026f1efbf78a15eb7

See more details on using hashes here.

File details

Details for the file spherical_tools-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for spherical_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 191024ce477e6fbe7d29e1b2fb3fc42a2a868e05622ff172fcd61b065803b182
MD5 bd96090314a8697f4f9d27b7f92b9f3b
BLAKE2b-256 44250bb81e9100df199d6634fa9fa09c2333d4a225aaaadac602d0ce8c5cd078

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page