#[repr(C)]pub struct Complex {
pub re: f32,
pub im: f32,
}Fields§
§re: f32§im: f32Implementations§
Source§impl Complex
impl Complex
pub const ZERO: Self
pub const ONE: Self
pub const NEG_ONE: Self
pub const I: Self
pub const NEG_I: Self
pub const fn new(re: f32, im: f32) -> Self
pub const fn conjugate(self) -> Self
pub fn abs(self) -> f32
pub fn abs_sq(self) -> f32
pub fn arg(self) -> f32
pub fn recip(self) -> Self
pub fn sqrt(self) -> Self
pub fn to_polar(self) -> ComplexPolar
pub fn exp(self) -> ComplexPolar
pub fn log(self) -> Self
pub fn powi(self, n: i32) -> ComplexPolar
pub fn powf(self, x: f32) -> ComplexPolar
pub fn distance(self, other: Self) -> f32
pub fn distance_squared(self, other: Self) -> f32
Trait Implementations§
Source§impl AbsDiffEq for Complex
impl AbsDiffEq for Complex
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 AddAssign<f32> for Complex
impl AddAssign<f32> for Complex
Source§fn add_assign(&mut self, re: f32)
fn add_assign(&mut self, re: f32)
Performs the
+= operation. Read moreSource§impl AddAssign for Complex
impl AddAssign for Complex
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl Distribution<Complex> for StandardUniform
impl Distribution<Complex> for StandardUniform
Source§impl DivAssign<f32> for Complex
impl DivAssign<f32> for Complex
Source§fn div_assign(&mut self, re: f32)
fn div_assign(&mut self, re: f32)
Performs the
/= operation. Read moreSource§impl DivAssign for Complex
impl DivAssign for Complex
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moreSource§impl MulAssign<f32> for Complex
impl MulAssign<f32> for Complex
Source§fn mul_assign(&mut self, re: f32)
fn mul_assign(&mut self, re: f32)
Performs the
*= operation. Read moreSource§impl MulAssign for Complex
impl MulAssign for Complex
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moreSource§impl RelativeEq for Complex
impl RelativeEq for Complex
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 SubAssign<f32> for Complex
impl SubAssign<f32> for Complex
Source§fn sub_assign(&mut self, re: f32)
fn sub_assign(&mut self, re: f32)
Performs the
-= operation. Read moreSource§impl SubAssign for Complex
impl SubAssign for Complex
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreSource§impl UlpsEq for Complex
impl UlpsEq for Complex
impl 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