pub trait HexPoint:
Copy
+ Eq
+ Ord
+ Display
+ Debug {
// Required methods
fn as_cubic_point(&self) -> CubicPoint;
fn as_axial_point(&self) -> AxialPoint;
// Provided methods
fn as_joint(&self, direction: Orientation) -> Joint { ... }
fn go(&self, direction: Orientation) -> CubicPoint { ... }
fn get_pixel_center(&self, radius: f64) -> (f64, f64) { ... }
fn get_pixel_corners(&self, radius: f64) -> [(f64, f64); 6] { ... }
fn taxicab_distance<P>(&self, other: P) -> usize
where P: HexPoint { ... }
fn euclidean_distance<P>(&self, other: P, radius: f64) -> f64
where P: HexPoint { ... }
}Required Methods§
Sourcefn as_cubic_point(&self) -> CubicPoint
fn as_cubic_point(&self) -> CubicPoint
Create a new point in cubic coordinates
Sourcefn as_axial_point(&self) -> AxialPoint
fn as_axial_point(&self) -> AxialPoint
Create a new point in axial coordinates from pixel coordinates
Provided Methods§
fn as_joint(&self, direction: Orientation) -> Joint
fn go(&self, direction: Orientation) -> CubicPoint
Sourcefn get_pixel_center(&self, radius: f64) -> (f64, f64)
fn get_pixel_center(&self, radius: f64) -> (f64, f64)
Get the pixel coordinates of the center of the hexagon
Sourcefn get_pixel_corners(&self, radius: f64) -> [(f64, f64); 6]
fn get_pixel_corners(&self, radius: f64) -> [(f64, f64); 6]
Get the pixel coordinates of the corners of the hexagon
Sourcefn taxicab_distance<P>(&self, other: P) -> usizewhere
P: HexPoint,
fn taxicab_distance<P>(&self, other: P) -> usizewhere
P: HexPoint,
Calculate the manhattan distance between two points
Sourcefn euclidean_distance<P>(&self, other: P, radius: f64) -> f64where
P: HexPoint,
fn euclidean_distance<P>(&self, other: P, radius: f64) -> f64where
P: HexPoint,
Calculate the euclidean distance between two points
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.