pub struct Complex {
pub real: f64,
pub imaginary: f64,
}Expand description
Represents a complex number located on a “unit” plane.
Fields§
§real: f64X coordinate located in range [0, 1).
imaginary: f64Y coordinate located in range [0, 1).
Implementations§
source§impl Complex
impl Complex
pub fn new(real: f64, imaginary: f64) -> Self
pub fn zero() -> Self
pub fn i() -> Self
pub fn mangitude(self) -> f64
pub fn conjugate(self) -> Complex
pub fn partial_mul(self, other: Complex) -> Complex
pub fn partial_div(self, other: Complex) -> Complex
pub fn arg(self) -> f64
pub fn normalize(self) -> Complex
pub fn sqrt(self) -> Complex
Trait Implementations§
source§impl AddAssign<Complex> for Complex
impl AddAssign<Complex> for Complex
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl SubAssign<Complex> for Complex
impl SubAssign<Complex> for Complex
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Complex
Auto Trait Implementations§
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