Utilities for working with spherical geometry
Project description
spherical-tools
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a8bf46159e7e76cba1a9258d7ea0bb090d114f61a879d2aaad7dea8c332bab4
|
|
| MD5 |
e40fda69dc2808e23939ac44970b44c2
|
|
| BLAKE2b-256 |
799a44326e9f75897a784a6da14a2940080e50a10698a3bc1917dfd9928800ff
|
File details
Details for the file spherical_tools-0.2.0-py3-none-any.whl.
File metadata
- Download URL: spherical_tools-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63aa61cbcb7d03eaecc01fd623dafc6a2964b29720db5492b9ec8d19f6c5c05a
|
|
| MD5 |
752e76cb1011f27bf1fe1b34011e013f
|
|
| BLAKE2b-256 |
df666023e7d476557834321dfa74fa98280149ab37748b99fb1cd0e82ff039ca
|