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.2.0.tar.gz (12.5 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.2.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spherical_tools-0.2.0.tar.gz
  • Upload date:
  • Size: 12.5 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.2.0.tar.gz
Algorithm Hash digest
SHA256 3a8bf46159e7e76cba1a9258d7ea0bb090d114f61a879d2aaad7dea8c332bab4
MD5 e40fda69dc2808e23939ac44970b44c2
BLAKE2b-256 799a44326e9f75897a784a6da14a2940080e50a10698a3bc1917dfd9928800ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spherical_tools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63aa61cbcb7d03eaecc01fd623dafc6a2964b29720db5492b9ec8d19f6c5c05a
MD5 752e76cb1011f27bf1fe1b34011e013f
BLAKE2b-256 df666023e7d476557834321dfa74fa98280149ab37748b99fb1cd0e82ff039ca

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