linum 0.1.2

An open-source 2D-, and 3D-Vector Library.
Documentation
  • Coverage
  • 25%
    9 out of 36 items documented0 out of 26 items with examples
  • Size
  • Source code size: 23.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.12 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Sietse2202

Linum

Linum is an Open-Source vector library made for Game Development, and general Physics. The name comes from the Latin word 'linum', meaning thread. The English words 'line', and 'linear' both come from Latin 'linea' which comes from linum.

Examples

Below is an example of some things linum can do:

use linum::prelude::*;

fn main() {
    {
        let vec = vec2d(5.0, 0.0);
        let rotated = vec.rotate_deg(180.0);
        println!("{:?}", rotated) // Prints `Vec2D { x: -5.0, y: 0.0 }`
    }
    {
        let vec1 = Vec2D::from(vec![3,7]);
        let vec2 = vec2d(0u8, 5u8);
        println!("Result = {:?}", vec1 + vec2.cast().unwrap()); // Prints `Vec2D { x: 3, y: 12 }`
    }
    {
        let vec1 = vec2d(3u8, 6u8);
        let scalar = 5f64;
        println!("Result = {:?}", vec1.cast().unwrap() * scalar); // Prints `Vec2D { x: 15.0, y: 30.0 }
    }
}