#[repr(C)]pub struct Complex<FT> {
pub re: FT,
pub im: FT,
}Expand description
A complex number in rectangular form.
Fields§
§re: FT§im: FTImplementations§
Source§impl<FT: Number> Complex<FT>
impl<FT: Number> Complex<FT>
pub const ZERO: Self
pub const ONE: Self
pub const I: Self
Sourcepub fn abs_sq(self) -> FT
pub fn abs_sq(self) -> FT
Computes the squared absolute value.
This is faster than abs() as it avoids a square root operation.
Sourcepub fn distance_squared(self, other: Self) -> FT
pub fn distance_squared(self, other: Self) -> FT
Computes the squared euclidian distance between two points.
Trait Implementations§
Source§impl<FT: AbsDiffEq + Copy> AbsDiffEq for Complex<FT>
Available on crate feature approx only.
impl<FT: AbsDiffEq + Copy> AbsDiffEq for Complex<FT>
Available on crate feature
approx only.Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl<FT: Number> AddAssign<FT> for Complex<FT>
impl<FT: Number> AddAssign<FT> for Complex<FT>
Source§fn add_assign(&mut self, re: FT)
fn add_assign(&mut self, re: FT)
Performs the
+= operation. Read moreSource§impl<FT: Number> AddAssign for Complex<FT>
impl<FT: Number> AddAssign for Complex<FT>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl Distribution<Complex<f32>> for StandardUniform
Available on crate feature rand only.
impl Distribution<Complex<f32>> for StandardUniform
Available on crate feature
rand only.Source§impl Distribution<Complex<f64>> for StandardUniform
Available on crate feature rand only.
impl Distribution<Complex<f64>> for StandardUniform
Available on crate feature
rand only.Source§impl<FT: Number> DivAssign<FT> for Complex<FT>
impl<FT: Number> DivAssign<FT> for Complex<FT>
Source§fn div_assign(&mut self, re: FT)
fn div_assign(&mut self, re: FT)
Performs the
/= operation. Read moreSource§impl<FT: Number> DivAssign for Complex<FT>
impl<FT: Number> DivAssign for Complex<FT>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moreSource§impl<FT: Number> MulAssign<FT> for Complex<FT>
impl<FT: Number> MulAssign<FT> for Complex<FT>
Source§fn mul_assign(&mut self, re: FT)
fn mul_assign(&mut self, re: FT)
Performs the
*= operation. Read moreSource§impl<FT: Number> MulAssign for Complex<FT>
impl<FT: Number> MulAssign for Complex<FT>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moreSource§impl<FT: RelativeEq + Copy> RelativeEq for Complex<FT>
Available on crate feature approx only.
impl<FT: RelativeEq + Copy> RelativeEq for Complex<FT>
Available on crate feature
approx only.Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<FT: Number> SubAssign<FT> for Complex<FT>
impl<FT: Number> SubAssign<FT> for Complex<FT>
Source§fn sub_assign(&mut self, re: FT)
fn sub_assign(&mut self, re: FT)
Performs the
-= operation. Read moreSource§impl<FT: Number> SubAssign for Complex<FT>
impl<FT: Number> SubAssign for Complex<FT>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreSource§impl<FT: UlpsEq + Copy> UlpsEq for Complex<FT>
Available on crate feature approx only.
impl<FT: UlpsEq + Copy> UlpsEq for Complex<FT>
Available on crate feature
approx only.impl<FT: Copy> Copy for Complex<FT>
impl<FT> StructuralPartialEq for Complex<FT>
Auto Trait Implementations§
impl<FT> Freeze for Complex<FT>where
FT: Freeze,
impl<FT> RefUnwindSafe for Complex<FT>where
FT: RefUnwindSafe,
impl<FT> Send for Complex<FT>where
FT: Send,
impl<FT> Sync for Complex<FT>where
FT: Sync,
impl<FT> Unpin for Complex<FT>where
FT: Unpin,
impl<FT> UnwindSafe for Complex<FT>where
FT: UnwindSafe,
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