#vector #vector-math #rectangle #matrix #vector-matrix

nightly hexga_math

Math related crate that support multi dimensionnal vector, matrix, rectangle

8 releases

Uses new Rust 2024

new 0.0.10-beta.10 May 12, 2025
0.0.10-beta.7 May 10, 2025
0.0.10-beta.3 Apr 20, 2025
0.0.10-beta.1 Mar 31, 2025

#1066 in Math

Download history 475/week @ 2025-03-26 156/week @ 2025-04-02 36/week @ 2025-04-09 144/week @ 2025-04-16 17/week @ 2025-04-23 721/week @ 2025-05-07

883 downloads per month
Used in 2 crates

MIT/Apache

375KB
6K SLoC

🚧 Warning: Experimental Crate! 🚧

This crate is currently in beta and experimental.
It is subject to breaking changes in future releases.
Use it at your own risk, and keep in mind that the API may change in future versions.

HexGa Math

Provide math related structure for multiple dimension, with a lot of typedef to them like :

  • Vector (Vec2,Vec3,Vec4 for a vector of float,... Point2,Point3,Point4 for int...)

  • Rectangle (Rect2,Rect3,Rect4 for float, Rect2P,Rect3P,Rect4P for int/point)

  • Matrix (Matrix, Mat2,Mat3,Mat4 for float, Mat2P,Mat3P,Mat4P for int , SquareMatrix...)

  • Grid (Grid2, Grid3, Grid4...)

Also provide

  • some lightweight unit of measurement : Time, Angle. assert_eq!([1,2].degree(), [1.degree(),2.degree()])

  • some prefix : kilo, giga, mega... assert_eq!(1.kilo(), 1000),

  • Color (ColorRGBA, ColorHSLA). <- They will probably be moved into another crate for graphics, but for now they stay here (because of macro)

Main Hexga crate

Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.

Dependencies

~1.4–2.1MB
~45K SLoC