monge_rs/lib.rs
1//! # monge-rs
2//!
3//! A Rust implementation of Monge's theorem for fleet mathematics,
4//! designed to integrate with Forgemaster's constraint theory
5//! (jc1-ct-bridge).
6//!
7//! ## Overview
8//!
9//! Monge's theorem states that for three circles in the plane, the three
10//! external homothetic centers are collinear. This crate implements the
11//! theorem and its generalizations, providing:
12//!
13//! - **Homothetic centers** — external and internal for pairs of circles
14//! - **Radical axes** — as 1-cocycles in Čech cohomology
15//! - **Zero Holonomy Consensus** — a Lyapunov-based distributed consensus protocol
16//! - **Pythagorean48** — zero-drift verification using 48 lattice directions
17//! - **nD Lassak generalization** — Monge's theorem in higher dimensions
18//!
19//! ## Quick Start
20//!
21//! ```rust
22//! use nalgebra::Vector2;
23//! use monge_rs::geometry::Circle;
24//! use monge_rs::homothetic::{external_homothetic_center, monge_collinear_area};
25//!
26//! let c1 = Circle::new(Vector2::new(0.0, 0.0), 1.0);
27//! let c2 = Circle::new(Vector2::new(4.0, 0.0), 2.0);
28//! let c3 = Circle::new(Vector2::new(2.0, 3.0), 1.5);
29//!
30//! // External homothetic centers
31//! let s12 = external_homothetic_center(&c1, &c2).unwrap();
32//! let s23 = external_homothetic_center(&c2, &c3).unwrap();
33//! let s31 = external_homothetic_center(&c3, &c1).unwrap();
34//!
35//! // Verify Monge collinearity (area should be ≈ 0)
36//! let area = monge_collinear_area(&c1, &c2, &c3).unwrap();
37//! assert!(area < 1e-10);
38//! ```
39//!
40//! ## Modules
41//!
42//! - [`geometry`] — foundational types (Circle, Sphere, 3D lifting, nD generalization)
43//! - [`homothetic`] — external and internal homothetic centers
44//! - [`radical_axis`] — radical axis as 1-cocycle, radical center
45//! - [`consensus`] — zero holonomy consensus protocol
46//! - [`p48`] — Pythagorean48 verification framework
47
48pub mod geometry;
49pub mod homothetic;
50pub mod radical_axis;
51pub mod consensus;
52pub mod p48;