pub struct Complex {
pub real: f64,
pub imaginary: f64,
}
Expand description
Represents a complex number located on a “unit” plane.
Fields§
§real: f64
X coordinate located in range [0, 1).
imaginary: f64
Y 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 for Complex
impl AddAssign for Complex
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl SubAssign for Complex
impl SubAssign 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
source§impl<T> CloneWithNode for Twhere
T: Clone,
impl<T> CloneWithNode for Twhere
T: Clone,
fn clone_with_node(&mut self) -> T
fn clone_without_node(&self) -> T
source§impl<T> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more