pub struct Complex { /* private fields */ }
Expand description
Holds a complex number with 64-bit float parts.
Implementations§
Source§impl Complex
impl Complex
Sourcepub fn new(re: f64, im: f64) -> Complex
pub fn new(re: f64, im: f64) -> Complex
Construct a new complex number as re + im * i
with 64-bit float parts.
Sourcepub fn new_euler(r: f64, phi: f64) -> Complex
pub fn new_euler(r: f64, phi: f64) -> Complex
Construct a new complex number as r * exp(i * phi)
with 64-bit float parts.
Sourcepub fn nth_root_of_unity(n: u32) -> Complex
pub fn nth_root_of_unity(n: u32) -> Complex
Construct a new primitive nth root of unity.
Trait Implementations§
Source§impl AddAssign for Complex
impl AddAssign for Complex
Source§fn add_assign(&mut self, rhs: Complex)
fn add_assign(&mut self, rhs: Complex)
Performs the
+=
operation. Read moreSource§impl MulAssign for Complex
impl MulAssign for Complex
Source§fn mul_assign(&mut self, rhs: Complex)
fn mul_assign(&mut self, rhs: Complex)
Performs the
*=
operation. Read moreimpl Copy for Complex
impl StructuralPartialEq for Complex
Auto Trait Implementations§
impl Freeze for Complex
impl RefUnwindSafe for Complex
impl Send for Complex
impl Sync for Complex
impl Unpin for Complex
impl UnwindSafe for Complex
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