struct Point3D(i32, i32, i32);
Expand description
Stores coordinates in x, y, z order.
Tuple Fields§
§0: i32
§1: i32
§2: i32
Implementations§
source§impl Point3D
impl Point3D
fn parse([x, y, z]: [i32; 3]) -> Point3D
sourcefn transform(&self, index: usize) -> Point3D
fn transform(&self, index: usize) -> Point3D
There are 24 possible 3D rotations of each point in increments of 90 degrees.
sourcefn euclidean(&self, other: &Point3D) -> i32
fn euclidean(&self, other: &Point3D) -> i32
No need to take the square root as it’s faster and easier to just use the integer value of the distance squared directly.
fn manhattan(&self, other: &Point3D) -> i32
Trait Implementations§
impl Copy for Point3D
impl Eq for Point3D
impl StructuralPartialEq for Point3D
Auto Trait Implementations§
impl Freeze for Point3D
impl RefUnwindSafe for Point3D
impl Send for Point3D
impl Sync for Point3D
impl Unpin for Point3D
impl UnwindSafe for Point3D
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)