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

hexga_math

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

3 releases

Uses new Rust 2024

new 0.0.10-beta.3 Apr 20, 2025
0.0.10-beta.2 Apr 7, 2025
0.0.10-beta.1 Mar 31, 2025

#976 in Math

Download history 475/week @ 2025-03-26 156/week @ 2025-04-02 36/week @ 2025-04-09

667 downloads per month
Used in hexga

MIT/Apache

260KB
4.5K 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

~0.3–0.9MB
~20K SLoC