Skip to main content

High-performance 3D coordinate system library with unified differential geometry, frame algebra, and topological-physics formula APIs

Project description

Coordinate System Library

High-performance 3D coordinate system and differential geometry library for Python.

PyPI version Python License

Authors: Pan Guojun
Version: 8.0.0
License: MIT
DOI: https://doi.org/10.5281/zenodo.14435613


Highlights

  • C++ math core: vec3, quat, coord3
  • Intrinsic gradient curvature (default)
  • Classical finite-difference curvature (reference)
  • Analytical fast path for Sphere/Torus and surfaces that provide derivatives
  • Caching for repeated samples
  • Spectral geometry and U(3) frame utilities

Installation

pip install coordinate-system

Quick Start

Vectors and Frames

from coordinate_system import vec3, quat, coord3

v1 = vec3(1, 2, 3)
v2 = vec3(4, 5, 6)
dot = v1.dot(v2)
cross = v1.cross(v2)

q = quat(1.5708, vec3(0, 0, 1))  # 90 degrees around Z
rotated = q * v1

frame = coord3.from_angle(1.57, vec3(0, 0, 1))
world_pos = v1 * frame
local_pos = world_pos / frame

Curvature (Differential Geometry)

from coordinate_system import Sphere, compute_gaussian_curvature, compute_mean_curvature

sphere = Sphere(radius=1.0)
K = compute_gaussian_curvature(sphere, u=0.5, v=0.5)
H = compute_mean_curvature(sphere, u=0.5, v=0.5)
print(K, H)

Notes:

  • Intrinsic method returns signed mean curvature.
  • Classical method returns absolute mean curvature.

Topological Physics APIs

from coordinate_system import (
    lambda0, lambda_running, mass_from_winding_eV,
    winding_from_mass, nmax_dynamic_stall, proton_neutron_split_mev
)

lam0 = lambda0(theta=1.0)
lam_keV = lambda_running(energy_eV=5e3, e0_eV=0.026, beta=0.02)
me = mass_from_winding_eV(1257, e0_eV=0.026, beta=0.5)
ne = winding_from_mass(0.51099895e6, e0_eV=0.026, beta=0.5)

print(lam0, lam_keV, me, ne)

Notes:

  • topological_physics exposes public scalar formula interfaces for CFUT workflows.
  • Sensitive unified field-equation internals are intentionally not exposed in this module.

Curvature APIs

Intrinsic (default):

  • compute_gaussian_curvature(surface, u, v, step_size=1e-3)
  • compute_mean_curvature(surface, u, v, step_size=1e-3)
  • compute_riemann_curvature(surface, u, v, step_size=1e-3)
  • compute_curvature_tensor(surface, u, v, step_size=1e-3)

Classical (reference):

  • gaussian_curvature_classical(surface, u, v, step_size=1e-3)
  • mean_curvature_classical(surface, u, v, step_size=1e-3)

Methods

Intrinsic Gradient (default)

Computes curvature from the intrinsic frame and the gradient of the normal field. This path is usually faster and stable on smooth surfaces.

Classical Finite Differences

Uses 5-point stencils to compute first and second derivatives and then builds the fundamental forms. This is useful as a numerical reference.


Project Layout

coordinate_system/
  coordinate_system.pyd/.so      # C++ core (vec3, quat, coord3)
  complex_geometric_physics.py   # Complex geometric physics module
  spectral_geometry.py           # FourierFrame, spectral analysis
  u3_frame.py                    # U3Frame, gauge field theory
  differential_geometry.py       # Surface curvature
  visualization.py               # 3D visualization
  curve_interpolation.py         # C2-continuous interpolation
  topological_physics.py         # Public-safe topological physics formulas

Performance Notes

Performance depends on hardware and step size. For local benchmarks:

  • vec3 microbenchmarks: bench/compare_perf.py
  • curvature examples: examples/curvature_computation.py

Changelog

v8.0.0 (2026-03-04)

  • Added topological_physics module with public-safe CFUT formula interfaces.
  • Added shared-parameter mass/winding APIs (mass_from_winding_eV, winding_from_mass).
  • Added dynamic-stall and TME helper interfaces (nmax_dynamic_stall, tme_conductance).
  • Restricted top-level export surface to avoid exposing secret field-equation entry points.

v7.1.2 (2026-02-09)

  • Intrinsic curvature sampling reuse for numeric surfaces (13 position calls per point)
  • Documentation updates and benchmark clarity

v7.1.1 (2026-02-05)

  • Analytical curvature fast path (Sphere/Torus and surfaces with derivatives)
  • Caching for curvature calculators and last-call results
  • AVX2 / fast-math enabled in native build config

License

MIT License - Copyright (c) 2024-2026 Pan Guojun


Links

Project details


Release history Release notifications | RSS feed

This version

8.0.0

Download files

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

Source Distribution

coordinate_system-8.0.0.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

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

coordinate_system-8.0.0-cp313-cp313-win_amd64.whl (236.0 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file coordinate_system-8.0.0.tar.gz.

File metadata

  • Download URL: coordinate_system-8.0.0.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for coordinate_system-8.0.0.tar.gz
Algorithm Hash digest
SHA256 3113d4c612cfe4c59ad1b08badd0ca3217e918b7368e0f19ac286b88f0c14715
MD5 9b612d106d959d623409bed589f7831a
BLAKE2b-256 34a9378d14c3b674f5b3618b48a63218ee4d46778d9f7437039d5ebb969640cb

See more details on using hashes here.

File details

Details for the file coordinate_system-8.0.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for coordinate_system-8.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4389aade5163450e7d9d99712f0fd677de62cd7614c7ee279ccf79adbe9ed2c3
MD5 a7d2f9602b00a78c4e103d0b5bf16fd1
BLAKE2b-256 f41d9e23393e00359306ba1f4a46d573ff92dddc607a22bda6c9436b770ef062

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