mathpak 0.4.0

Rust Math Routines, a simple to use math focused library written in rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use float_cmp::F64Margin;

pub trait Point {
    fn is_valid(&self) -> bool;
    fn add(&mut self, other: Self);
    fn sub(&mut self, other: Self);
    fn distance(&self, other: Self) -> f64;
    fn distance_from_origin(&self) -> f64;
    fn scale(&mut self, factor: f64);
    fn lerp(&self, other: Self, t: f64) -> Self;
    fn is_equal_marginal(&self, other: Self, margin: F64Margin) -> bool;
}