Documentation
  • Coverage
  • 55.17%
    16 out of 29 items documented16 out of 16 items with examples
  • Size
  • Source code size: 20.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • piot/int-math-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • piot

📐 int_math

int_math is a Rust crate providing mathematical abstractions for 2D vectors and rectangles. It includes:

  • UVec2: A 2D vector with unsigned integer coordinates.
  • Vec2: A 2D vector with signed integer coordinates.
  • Vec3: A 3D vector with signed integer coordinates.
  • URect: A rectangle with unsigned integer coordinates for position and size.
  • Rect: A rectangle with signed integer coordinates for position and unsigned integer dimensions.

✨ Features

  • Vector Operations: Supports basic arithmetic operations for UVec2 and Vec2.
  • Rectangles: Provides methods to create and manipulate rectangles, including calculating centers and applying offsets.

📦 Installation

Add int_math to your Cargo.toml:

[dependencies]
int_math = "0.0.2"

Then, use it in your code:

use int_math::{URect, UVec2};

let rect = URect::new(10, 20, 30, 40);
let center = rect.center();
println!("Center: {:?}", center);

License

Licensed under the MIT License. See the LICENSE file for details.