| Crates.io | uvoxxyz |
| lib.rs | uvoxxyz |
| version | 0.2.0 |
| created_at | 2025-09-21 18:34:12.323228+00 |
| updated_at | 2025-09-23 20:43:19.146557+00 |
| description | Bridge between UVoxID spherical space and Cartesian XYZ + quaternions |
| homepage | |
| repository | https://github.com/JDPlumbing/uvoxxyz-rs |
| max_upload_size | |
| id | 1849027 |
| size | 37,549 |
Created by JDPlumbing
cargo install uvoxxyz
Bridge between spherical UvoxId coordinates and Cartesian space, with quaternion support.
uvoxxyz lets you:
Convert between uvoxid spherical IDs and 3D Cartesian coordinates.
Choose between math convention (X/Y horizontal, Z up) and graphics convention (X/Z horizontal, Y up).
Apply quaternions for orientation and rotation in either system.
use uvoxid::UvoxId;
use uvoxxyz::types::{CoordSystem, Cartesian, Quaternion};
use uvoxxyz::convert::*;
fn main() {
// A UvoxId located at radius=1m, lat=0, lon=0
let id = UvoxId::new(0, 1_000_000, 0, 0);
// Convert to Cartesian (math convention)
let cart = id.to_cartesian(CoordSystem::Math);
println!("Cartesian: ({}, {}, {})", cart.x, cart.y, cart.z);
// Rotate by 90° around Z
let q = Quaternion::from_axis_angle(
Cartesian { x: 0.0, y: 0.0, z: 1.0 },
std::f64::consts::FRAC_PI_2
);
let rotated = q.rotate(cart);
println!("Rotated: ({}, {}, {})", rotated.x, rotated.y, rotated.z);
// Convert back to UvoxId
let round_trip = UvoxId::from_cartesian(rotated, CoordSystem::Math, 0);
println!("Back to UvoxId: {}", round_trip);
}
UvoxId → Cartesian and backuvoxid: Hierarchical spherical integer coordinate systemgeospec: Geometric shapes and inference utilitiesMIT or Apache-2.0, at your option.
Rust 1.70+