ngeom

Crates.iongeom
lib.rsngeom
version0.1.0
sourcesrc
created_at2024-09-27 02:50:42.640211
updated_at2024-09-27 02:50:42.640211
descriptionGeometry in N dimensions
homepage
repositoryhttps://github.com/ervanalb/ngeom
max_upload_size
id1388202
size94,714
Eric Van Albert (ervanalb)

documentation

README

ngeom

ngeom is a library for doing geometry in N dimensions.

ngeom ships with modules for rigid Euclidean 2D and 3D geometry. The built-in modules provide primitives for points, lines, and planes, along with rigid transformations (rotations, translations, and reflections.)

If you prefer to own your geometric primitives, or if you desire a space with different dimensionality, metric, handedness, etc. then you can use the provided macro to generate all the necessary geometric operations on your own structs.

ngeom uses homogeneous coordinates to express ideal/infinite points, ideal/infinite lines, etc. and to provide for exception-free meet & join operations.

ngeom is generic over the [scalar] datatype, and can be used with f32, f64, or custom datatypes. It can even use integers, with some restrictions-- most functionality requires only scalar addition and multiplication.

With some effort, usage code can be written to be generic over the dimensionality or even the metric of the space.

ngeom does not use SIMD intrinsics, but rather emits compact expressions and structs that are easy for the compiler to optimize into SIMD instructions in an architecture-independent way.

ngeom is dependency-free. ngeom is no_std-compatible, with most functionality available, and the option to implement the rest.

Under the hood, ngeom is able to make these generalizations by using geometric algebra. Understanding geometric algebra is helpful but optional, as the functions are named for their geometric interpretation. Lower-level functions named after their geometric algebra expressions are available if needed.

Commit count: 61

cargo fmt