pub struct Eisenstein {
pub a: i64,
pub b: i64,
}Expand description
An Eisenstein integer a + bω.
ω = e^(2πi/3) = (-1 + i√3)/2 is a primitive cube root of unity.
Eisenstein integers form a hexagonal lattice in the complex plane.
Fields§
§a: i64Coefficient of 1
b: i64Coefficient of ω
Implementations§
Source§impl Eisenstein
impl Eisenstein
Sourcepub fn to_cartesian(self) -> (f64, f64)
pub fn to_cartesian(self) -> (f64, f64)
Convert to Cartesian (x, y) coordinates.
The conversion is:
x = a - b/2
y = (√3 / 2) · bTrait Implementations§
Source§impl Clone for Eisenstein
impl Clone for Eisenstein
Source§fn clone(&self) -> Eisenstein
fn clone(&self) -> Eisenstein
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Eisenstein
Source§impl Debug for Eisenstein
impl Debug for Eisenstein
Source§impl PartialEq for Eisenstein
impl PartialEq for Eisenstein
impl StructuralPartialEq for Eisenstein
Auto Trait Implementations§
impl Freeze for Eisenstein
impl RefUnwindSafe for Eisenstein
impl Send for Eisenstein
impl Sync for Eisenstein
impl Unpin for Eisenstein
impl UnsafeUnpin for Eisenstein
impl UnwindSafe for Eisenstein
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