1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Mathematical and geometrical abstractions with a focus on ergonomics.
//!
//! ## Disclaimer
//! This library is a work in progress still,
//! there may be breaking changes between versions.
//!
//! If you want a missing feature
//! or want to report a bug, please create an issue on GitHub.
//!
//! # Examples
//! ```
//! // Import the prelude for convenience
//! use geologic::*;
//!
//! let position = point!(0i32, 40);
//! let size = size!(5; 2);
//!
//! // Derive a Bounds2D from a position and size.
//! let bounds = position.with_size(size);
//!
//! // Translate the bounds with an offset
//! let moved_bounds = bounds + offset!(3, 5);
//!
//! // Resize the bounds up with a size
//! let enlarged_bounds = moved_bounds + size!(10, 10);
//! assert_eq!(enlarged_bounds, bounds!(3, 45, 15, 15));
//!
//! // We can also use tuples and types interchangeably for operations like these
//! let moved_bounds = bounds.with_position((0, 0));
//! assert_eq!(moved_bounds, bounds!(0, 0, 5, 5))
//! ```

#[macro_use]
pub mod macros;

mod bounds;
mod grid;
mod offset;
mod point;
mod size;
mod vector;

pub use crate::bounds::*;
pub use crate::grid::*;
pub use crate::macros::*;
pub use crate::offset::*;
pub use crate::point::*;
pub use crate::size::*;
pub use crate::vector::*;