Skip to main content

hexx/direction/
mod.rs

1/// Hexagonal neighbor/edge directions
2mod edge_direction;
3/// Trait implementations
4mod impls;
5/// Test module
6#[cfg(test)]
7mod tests;
8/// Hexagonal vertex/diagonal directions
9mod vertex_direction;
10/// Direction way module
11pub(crate) mod way;
12
13pub use edge_direction::EdgeDirection;
14pub use vertex_direction::VertexDirection;
15pub use way::DirectionWay;
16
17/// Angle constants used for directions
18pub mod angles {
19    /// Angle in radian between *flat* and *pointy* top orientations.
20    /// Equivalent to 30 degrees
21    pub const DIRECTION_ANGLE_OFFSET_RAD: f32 = std::f32::consts::FRAC_PI_6;
22    /// Angle in radian between *flat* and *pointy* top orientations.
23    /// Equivalent to π / 6 in radians
24    pub const DIRECTION_ANGLE_OFFSET_DEGREES: f32 = 30.0;
25    /// Angle in radian between two adjacent directions counter clockwise.
26    /// Equivalent to 60 degrees
27    pub const DIRECTION_ANGLE_RAD: f32 = std::f32::consts::FRAC_PI_3;
28    /// Angle in degrees between two adjacent directions counter clockwise.
29    /// Equivalent to π / 3 in radians
30    pub const DIRECTION_ANGLE_DEGREES: f32 = 60.0;
31}