Skip to main content

Crate fleet_math_c

Crate fleet_math_c 

Source
Expand description

Fleet math library — C-compatible math primitives for fleet operations.

Provides Eisenstein integer operations, Laman rigidity checks, holonomy verification, Manhattan distance for vector search, and Pythagorean-48 directional encoding. All public functions are #[no_mangle] extern "C".

Structs§

SnapResult
Result of snapping a point to the nearest Eisenstein integer.

Constants§

PYTHAGOREAN_48_DIRECTIONS
Number of discrete directions in Pythagorean-48 encoding.

Functions§

batch_snap
Batch snap for interleaved (x, y) pairs.
fleet_eisenstein_norm
Eisenstein integer norm: N(a + bω) = a² − ab + b²
fleet_holonomy_check
Check if the product of integer transforms equals the identity (1).
fleet_is_rigid
Check whether a graph with vertices and edges satisfies the Laman rigidity condition E ≥ 2V − 3.
fleet_laman_edges
Minimum edges for a Laman-rigid graph on vertices vertices: 2V − 3.
fleet_manhattan_distance
Compute the Manhattan (L1) distance between two integer vectors.
fleet_pythagorean48_encode
Quantize a 2D angle (from x, y components) into one of 48 discrete directions.
snap
Snap a single (x, y) point to the nearest Eisenstein integer.