CubeSurfacePoint

Struct CubeSurfacePoint 

Source
pub struct CubeSurfacePoint<const BIG_LUTS: bool>(pub CubeSurfacePoint);
Expand description

A helper wrapper-type around a CubeSurfacePoint that operates using look-up tables.

A luts::CubeSurfacePoint::<false> only has LUTs 48 bytes long, but might need more than one look-up for each operation. A luts::CubeSurfacePoint::<true>, in contrast, has LUTs up to 2304 bytes long, but only ever needs one look-up per operation.

Tuple Fields§

§0: CubeSurfacePoint

Implementations§

Source§

impl<const BIG_LUTS: bool> CubeSurfacePoint<BIG_LUTS>

Source

pub const REFERENCE_POINT: Self

Please refer to the ordinary REFERENCE_POINT.

Source

pub const fn direction(self) -> Direction

Source§

impl CubeSurfacePoint<false>

Source

pub const fn one_right_angle_cw(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn one_right_angle_acw(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn beside(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn opposite(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn opposite_then_beside(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn flip_sign_of_2(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn flip_2_and_3(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn n_right_angles<const CLOCKWISE: bool>(self, angle: u8) -> Self

Source

pub const fn n_right_angles_acw(self, angle: u8) -> Self

Source

pub const fn n_right_angles_cw(self, angle: u8) -> Self

Source§

impl CubeSurfacePoint<true>

Source

pub const fn one_right_angle_cw(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn one_right_angle_acw(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn beside(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn opposite(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn opposite_then_beside(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn flip_sign_of_2(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn flip_2_and_3(self) -> Self

Please refer to the function of the same name in the basic CubeSurfacePoint.

Source

pub const fn n_right_angles_cw(self, angle: u8) -> Self

Source

pub const fn n_right_angles_acw(self, angle: u8) -> Self

Source

pub fn div_alt(self, divisor: Self) -> Rotation

An alternative implementation of division, that uses the same big LUT as multiplication does, but performs two look-ups instead of one.

Trait Implementations§

Source§

impl<const BIG_LUTS: bool> Clone for CubeSurfacePoint<BIG_LUTS>

Source§

fn clone(&self) -> CubeSurfacePoint<BIG_LUTS>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const BIG_LUTS: bool> Debug for CubeSurfacePoint<BIG_LUTS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div for CubeSurfacePoint<false>

Extracts the rotation that must occur so that the divisor point ends up coinciding with self, ie the dividend.

Source§

type Output = Rotation

This rotation can be either proper or improper.

Source§

fn div(self, divisor: Self) -> Self::Output

The operation occurs by finding the reciprocal of the divisor using a LUT, then rotating it according to self. The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl Div for CubeSurfacePoint<true>

Extracts the rotation that must occur so that the divisor point ends up coinciding with self, ie the dividend.

Source§

type Output = Rotation

This rotation can be either proper or improper.

Source§

fn div(self, divisor: Self) -> Self::Output

A look-up on a 2-D LUT produces the result directly.

Source§

impl<const BIG_LUTS: bool> From<CubeSurfacePoint<BIG_LUTS>> for CubeSurfacePoint

Source§

fn from(x: CubeSurfacePoint<BIG_LUTS>) -> Self

Converts to this type from the input type.
Source§

impl From<CubeSurfacePoint<false>> for Rotation

Source§

fn from(corresponding_point: CubeSurfacePoint<false>) -> Self

Converts to this type from the input type.
Source§

impl From<CubeSurfacePoint<true>> for Rotation

Source§

fn from(corresponding_point: CubeSurfacePoint<true>) -> Self

Converts to this type from the input type.
Source§

impl<const BIG_LUTS: bool> From<CubeSurfacePoint> for CubeSurfacePoint<BIG_LUTS>

Source§

fn from(x: CratePt) -> Self

Converts to this type from the input type.
Source§

impl From<Rotation> for CubeSurfacePoint<false>

Source§

fn from(x: Rotation) -> Self

Converts to this type from the input type.
Source§

impl From<Rotation> for CubeSurfacePoint<true>

Source§

fn from(x: Rotation) -> Self

Converts to this type from the input type.
Source§

impl Mul<CubeSurfacePoint<false>> for Rotation

Rotates a copy of a given CubeSurfacePoint according to self.

Source§

type Output = CubeSurfacePoint<false>

Output same as input.

Source§

fn mul(self, cub_sur_pt: Self::Output) -> Self::Output

The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl Mul<CubeSurfacePoint<true>> for Rotation

Rotates a copy of a given CubeSurfacePoint according to self.

Source§

type Output = CubeSurfacePoint<true>

Output same as input.

Source§

fn mul(self, cub_sur_pt: Self::Output) -> Self::Output

self is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

Source§

impl Mul<ImproperRotation> for CubeSurfacePoint<false>

Rotates a copy of self according to an ImproperRotation. Switches Geometric Group.

Source§

type Output = CubeSurfacePoint<false>

Although the Geometric Group does change, CubeSurfacePoint does not change its data-type depending on Geometric Group. Thus the data-type remains the same.

Source§

fn mul(self, x: ImproperRotation) -> Self

The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl Mul<ImproperRotation> for CubeSurfacePoint<true>

Rotates a copy of self according to an ImproperRotation. Switches Geometric Group.

Source§

type Output = CubeSurfacePoint<true>

Although the Geometric Group does change, CubeSurfacePoint does not change its data-type depending on Geometric Group. Thus the data-type remains the same.

Source§

fn mul(self, x: ImproperRotation) -> Self

The ImproperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl Mul<ProperRotation> for CubeSurfacePoint<false>

Rotates a copy of self according to a ProperRotation. Maintains Geometric Group.

Source§

type Output = CubeSurfacePoint<false>

The Geometric Group doesn’t change. Even if it did, this data-type is group-agnostic.

Source§

fn mul(self, x: ProperRotation) -> Self

The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl Mul<ProperRotation> for CubeSurfacePoint<true>

Rotates a copy of self according to a ProperRotation. Maintains Geometric Group.

Source§

type Output = CubeSurfacePoint<true>

The Geometric Group doesn’t change. Even if it did, this data-type is group-agnostic.

Source§

fn mul(self, x: ProperRotation) -> Self

The ProperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl Mul<Rotation> for CubeSurfacePoint<false>

Rotates a copy of self according to a Rotation.

Source§

type Output = CubeSurfacePoint<false>

We use the most general data-type possible, so the output does not change.

Source§

fn mul(self, rot: Rotation) -> Self::Output

The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl Mul<Rotation> for CubeSurfacePoint<true>

Rotates a copy of self according to a Rotation.

Source§

type Output = CubeSurfacePoint<true>

We use the most general data-type possible, so the output does not change.

Source§

fn mul(self, rot: Rotation) -> Self::Output

The Rotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

Source§

impl MulAssign<ImproperRotation> for CubeSurfacePoint<false>

Rotates self according to a ImproperRotation. Switches Geometric Group.

Source§

fn mul_assign(&mut self, x: ImproperRotation)

The data-type remains the same, despite the Geometric Group changing. Thus, the result can be directly assigned.

The ImproperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl MulAssign<ImproperRotation> for CubeSurfacePoint<true>

Rotates self according to an ImproperRotation. Switches Geometric Group.

Source§

fn mul_assign(&mut self, x: ImproperRotation)

The data-type remains the same, despite the Geometric Group changing. Thus, the result can be directly assigned.

The ImproperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl MulAssign<ProperRotation> for CubeSurfacePoint<false>

Rotates self according to a ProperRotation. Maintains Geometric Group.

Source§

fn mul_assign(&mut self, x: ProperRotation)

Neither the Geometric Group nor the data-type change, so the result can be directly assigned.

The ProperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl MulAssign<ProperRotation> for CubeSurfacePoint<true>

Rotates self according to a ProperRotation. Maintains Geometric Group.

Source§

fn mul_assign(&mut self, x: ProperRotation)

Neither the Geometric Group nor the data-type change, so the result can be directly assigned.

The ProperRotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

While this could have been implemented using smaller LUTs than the ones used for Mul<Rotation>, it was deemed a useless middle solution.

Source§

impl MulAssign<Rotation> for CubeSurfacePoint<false>

Rotates self according to a Rotation.

Source§

fn mul_assign(&mut self, rot: Rotation)

We use the most general data-type possible, so the output does not change. Thus, it can be directly assigned.

The rotation happens Elementary-Reflection-by-Elementary-Reflection as usual, but each Elementary Reflection is performed with a LUT.

Source§

impl MulAssign<Rotation> for CubeSurfacePoint<true>

Rotates self according to a Rotation.

Source§

fn mul_assign(&mut self, rot: Rotation)

We use the most general data-type possible, so the output does not change. Thus, it can be directly assigned.

The Rotation is not examined bit-by-bit. Instead, a look-up on a 2-D LUT produces the result directly.

Source§

impl OctahedrallySymmetricPoint for CubeSurfacePoint<false>

Source§

type OtherGroup = CubeSurfacePoint<false>

The geometric group mirror to the one to which self belongs.
Source§

fn beside(self) -> Self::OtherGroup

Returns the other point found in the same edge of the same face of the cube.
Source§

fn opposite(self) -> Self::OtherGroup

Returns the point in the corresponding position of the opposite face of the cube.
Source§

fn opposite_then_beside(self) -> Self

Functionally identical to self.opposite().beside(). Also available with the words swapped, as the order doesn’t matter. Read more
Source§

fn one_right_angle_cw(self) -> Self

Returns the point which is positioned 90° clockwise from self, as viewed from the face on which both are located.
Source§

fn one_right_angle_acw(self) -> Self

Returns the point which is positioned 90° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn flip_sign_of_2(self) -> Self::OtherGroup

Flips the sign of the coördinate whose absolute value is 2.
Source§

fn flip_2_and_3(self) -> Self

Flips the sign of the coördinates whose absolute values are 2 and 3. Read more
Source§

fn direction(self) -> Direction

Returns the spatial direction towards which self is oriented.
Source§

fn n_right_angles_cw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° clockwise from self, as viewed from the face on which both are located.
Source§

fn n_right_angles_acw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn odd_ones(self) -> bool

Counts how many ones there are in the binary representation of a certain point, so it can be judged in which geometric group it belongs.
Source§

fn even_ones(self) -> bool

Equal to the negation of Self::odd_ones by definition.
Source§

fn n_right_angles<const CLOCKWISE: bool>(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° from self, as viewed from the face on which both are located.
Source§

fn beside_then_opposite(self) -> Self

Source§

fn flip_1_and_3(self) -> Self

Source§

fn flip_sign_of_1(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::beside
Source§

fn flip_sign_of_3(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::opposite
Source§

fn flip_1_and_2(self) -> Self

Flips the sign of the coördinates whose absolute values are 1 and 2. Read more
Source§

impl OctahedrallySymmetricPoint for CubeSurfacePoint<true>

Source§

type OtherGroup = CubeSurfacePoint<true>

The geometric group mirror to the one to which self belongs.
Source§

fn beside(self) -> Self::OtherGroup

Returns the other point found in the same edge of the same face of the cube.
Source§

fn opposite(self) -> Self::OtherGroup

Returns the point in the corresponding position of the opposite face of the cube.
Source§

fn opposite_then_beside(self) -> Self

Functionally identical to self.opposite().beside(). Also available with the words swapped, as the order doesn’t matter. Read more
Source§

fn one_right_angle_cw(self) -> Self

Returns the point which is positioned 90° clockwise from self, as viewed from the face on which both are located.
Source§

fn one_right_angle_acw(self) -> Self

Returns the point which is positioned 90° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn flip_sign_of_2(self) -> Self::OtherGroup

Flips the sign of the coördinate whose absolute value is 2.
Source§

fn flip_2_and_3(self) -> Self

Flips the sign of the coördinates whose absolute values are 2 and 3. Read more
Source§

fn direction(self) -> Direction

Returns the spatial direction towards which self is oriented.
Source§

fn n_right_angles_cw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° clockwise from self, as viewed from the face on which both are located.
Source§

fn n_right_angles_acw(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° anti-clockwise from self, as viewed from the face on which both are located.
Source§

fn odd_ones(self) -> bool

Counts how many ones there are in the binary representation of a certain point, so it can be judged in which geometric group it belongs.
Source§

fn even_ones(self) -> bool

Equal to the negation of Self::odd_ones by definition.
Source§

fn n_right_angles<const CLOCKWISE: bool>(self, angle: u8) -> Self

Returns the point which is positioned (n * 90)° from self, as viewed from the face on which both are located.
Source§

fn beside_then_opposite(self) -> Self

Source§

fn flip_1_and_3(self) -> Self

Source§

fn flip_sign_of_1(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::beside
Source§

fn flip_sign_of_3(self) -> Self::OtherGroup

Different name for CubeSurfacePoint::opposite
Source§

fn flip_1_and_2(self) -> Self

Flips the sign of the coördinates whose absolute values are 1 and 2. Read more
Source§

impl<const BIG_LUTS: bool> Ord for CubeSurfacePoint<BIG_LUTS>

Source§

fn cmp(&self, other: &CubeSurfacePoint<BIG_LUTS>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const BIG_LUTS: bool> PartialEq for CubeSurfacePoint<BIG_LUTS>

Source§

fn eq(&self, other: &CubeSurfacePoint<BIG_LUTS>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const BIG_LUTS: bool> PartialOrd for CubeSurfacePoint<BIG_LUTS>

Source§

fn partial_cmp(&self, other: &CubeSurfacePoint<BIG_LUTS>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const BIG_LUTS: bool> Copy for CubeSurfacePoint<BIG_LUTS>

Source§

impl<const BIG_LUTS: bool> Eq for CubeSurfacePoint<BIG_LUTS>

Source§

impl<const BIG_LUTS: bool> StructuralPartialEq for CubeSurfacePoint<BIG_LUTS>

Auto Trait Implementations§

§

impl<const BIG_LUTS: bool> Freeze for CubeSurfacePoint<BIG_LUTS>

§

impl<const BIG_LUTS: bool> RefUnwindSafe for CubeSurfacePoint<BIG_LUTS>

§

impl<const BIG_LUTS: bool> Send for CubeSurfacePoint<BIG_LUTS>

§

impl<const BIG_LUTS: bool> Sync for CubeSurfacePoint<BIG_LUTS>

§

impl<const BIG_LUTS: bool> Unpin for CubeSurfacePoint<BIG_LUTS>

§

impl<const BIG_LUTS: bool> UnwindSafe for CubeSurfacePoint<BIG_LUTS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.