vectormatrix 0.1.0

Idiomatic Matrix and Vector types for Rust
Documentation
  • Coverage
  • 36.36%
    36 out of 99 items documented0 out of 74 items with examples
  • Size
  • Source code size: 239.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • drewcrawford/vectormatrix
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • drewcrawford

vectormatrix

Idiomatic Matrix and Vector types for Rust.

logo

This crate implements small stack-allocated Vector and Matrix types with the obvious semantics and operations. no_std support and zero dependencies.

Operations

Most obvious matrix and vector operations including:

  • scalar addition, subtraction, and multiplication, including operator overloading
  • elementwise addition, subtraction, and multiplication, including operator overloading wherever applicable
  • map operations
  • approximate equality for floating point types

vector operations

  • dot and cross product
  • length, square length
  • norm
  • convert to/from row and column matrix

matrix operations

  • matrix multiplication
  • transpose
  • determinant (for 2x2, 3x3, and 4x4)
  • inverse (for 2x2, 3x3, and 4x4)
  • common affine transformations: translation, rotation, scaling, shear

Type design

  • Use generics to support any element type
  • Use const generics to encode the matrix size in the type system and avoid heap allocation
  • Where practical, use generics for optimized code at any matrix size
  • Where mathematically appropriate, implement particular algorithms for particular size
  • Allow inline of most operations
  • Use repr(Rust) so that the compiler may optimize memory for simd, etc. (Convert to your own repr(C) type if you need specific memory layout).
  • API design should allow for simd or hardware accelerated ops 'in the future'.