| Crates.io | mobius-applicatio |
| lib.rs | mobius-applicatio |
| version | 0.1.1 |
| created_at | 2026-01-16 07:48:48.010535+00 |
| updated_at | 2026-01-21 05:33:33.927168+00 |
| description | A lean library for Möbius transformations on the complex plane |
| homepage | |
| repository | https://github.com/ConociendoAlmasMenosHastiadas/mobious-applicatio |
| max_upload_size | |
| id | 2048118 |
| size | 155,124 |
A lean Rust library for working with Möbius transformations on the extended complex plane (Riemann sphere).
Möbius transformations (also called linear fractional transformations) are conformal mappings of the form:
f(z) = (az + b) / (cz + d)
where a, b, c, d are complex numbers and ad - bc ≠ 0.
This library provides mathematically rigorous handling of the extended complex plane, including proper treatment of infinity as a single point regardless of sign.
Result for invalid transformationsResult<T, TransformError> for transform creationcomplex_utils module: COMPLEX_INFINITY constant, is_infinity(), and normalize_infinity() helpersapply(infinity) behavior: Handles all cases (c≠0/a=0 → 0, c=0/a≠0 → ∞, c≠0/a≠0 → a/c)vertical_grid(), horizontal_grid(), radial_grid(), angular_grid()The core library has minimal dependencies:
num-complex - Complex number supportndarray - N-dimensional arraysndarray-linalg - Linear algebra operationsGUI dependencies (egui/eframe) are only used in examples and are not included in the compiled library.
Add this to your Cargo.toml:
[dependencies]
mobius-applicatio = "0.1.1"
Basic example:
use mobius_applicatio::{MobiusTransform, TransformError};
use num_complex::Complex64;
// Create a transformation: f(z) = (2z + 1) / (z + 1)
let transform = MobiusTransform::new(
Complex64::new(2.0, 0.0), // a
Complex64::new(1.0, 0.0), // b
Complex64::new(1.0, 0.0), // c
Complex64::new(1.0, 0.0), // d
)?; // Returns Result<MobiusTransform, TransformError>
// Apply to a point
let z = Complex64::new(1.0, 1.0);
let result = transform.apply(z);
// Compose transformations
let inverse = transform.inverse();
let identity = transform.compose(&inverse);
Working with infinity:
use mobius_applicatio::complex_utils::{COMPLEX_INFINITY, is_infinity};
let result = transform.apply(COMPLEX_INFINITY);
if is_infinity(result) {
println!("Maps to infinity");
}
Using plane functions:
use mobius_applicatio::plane_functions;
use num_complex::Complex64;
let z = Complex64::new(1.0, 2.0);
if plane_functions::vertical_grid(z, 0.5, 0.01) {
// Point is on a vertical grid line
}
Run the interactive visualization tool:
cargo run --example visualize
This displays transformed grid patterns on the complex plane using different Möbius transformations.
cargo test
src/lib.rs - Core library implementation (lean, no GUI dependencies)examples/visualize.rs - Interactive visualization tool (uses egui)Cargo.toml - Dependencies separated: core vs dev-dependenciesMIT or Apache-2.0 (choose your preference)