Struct vecmat::Complex[][src]

#[repr(transparent)]
pub struct Complex<T> { /* fields omitted */ }

Complex number.

Implementations

impl<T> Complex<T>[src]

pub fn new(w: T, x: T) -> Self[src]

pub fn from_vector(vec: Vector2<T>) -> Self[src]

pub fn from_array(arr: [T; 2]) -> Self[src]

pub fn from_tuple(tup: (T, T)) -> Self[src]

pub fn from_num(nc: NumComplex<T>) -> Self[src]

pub fn into_vector(self) -> Vector2<T>[src]

pub fn into_array(self) -> [T; 2][src]

pub fn into_tuple(self) -> (T, T)[src]

pub fn into_num(self) -> NumComplex<T>[src]

impl<T: Copy> Complex<T>[src]

pub fn re(&self) -> T[src]

pub fn im(&self) -> T[src]

impl<T> Complex<T>[src]

pub fn re_ref(&self) -> &T[src]

pub fn im_ref(&self) -> &T[src]

pub fn re_mut(&mut self) -> &mut T[src]

pub fn im_mut(&mut self) -> &mut T[src]

impl<T> Complex<T> where
    T: Neg<Output = T> + Copy
[src]

pub fn into_matrix(self) -> Matrix2x2<T>[src]

impl<T> Complex<T> where
    T: Neg<Output = T>, 
[src]

pub fn conj(self) -> Self[src]

impl<T> Complex<T> where
    T: Zero + One
[src]

pub fn i() -> Self[src]

impl<T> Complex<T> where
    T: Add<Output = T> + Mul<Output = T> + Copy
[src]

pub fn norm_sqr(self) -> T[src]

impl<T: Float> Complex<T>[src]

pub fn norm(self) -> T[src]

pub fn arg(self) -> T[src]

pub fn to_polar(self) -> (T, T)[src]

pub fn from_polar(r: T, theta: T) -> Self[src]

impl<T> Complex<T> where
    T: Float
[src]

pub fn normalize(self) -> Self[src]

impl<T> Complex<T> where
    T: Neg<Output = T> + Num + Copy
[src]

pub fn inv(self) -> Self[src]

impl<T: Num + Copy> Complex<T>[src]

pub fn powu(&self, exp: u32) -> Self[src]

impl<T: Neg<Output = T> + Num + Copy> Complex<T>[src]

pub fn powi(&self, exp: i32) -> Self[src]

impl<T: Float> Complex<T>[src]

pub fn exp(self) -> Self[src]

pub fn ln(self) -> Self[src]

pub fn sqrt(self) -> Self[src]

pub fn cbrt(self) -> Self[src]

pub fn powf(self, exp: T) -> Self[src]

pub fn log(self, base: T) -> Self[src]

pub fn powc(self, exp: Self) -> Self[src]

pub fn expf(self, base: T) -> Self[src]

pub fn sin(self) -> Self[src]

pub fn cos(self) -> Self[src]

pub fn tan(self) -> Self[src]

pub fn asin(self) -> Self[src]

pub fn acos(self) -> Self[src]

pub fn atan(self) -> Self[src]

pub fn sinh(self) -> Self[src]

pub fn cosh(self) -> Self[src]

pub fn tanh(self) -> Self[src]

pub fn asinh(self) -> Self[src]

pub fn acosh(self) -> Self[src]

pub fn atanh(self) -> Self[src]

pub fn finv(self) -> Self[src]

pub fn fdiv(self, other: Self) -> Self[src]

Trait Implementations

impl<T> AbsDiffEq<Complex<T>> for Complex<T> where
    T: AbsDiffEq<Epsilon = T> + Copy
[src]

type Epsilon = T

Used for specifying relative comparisons.

fn default_epsilon() -> Self::Epsilon[src]

The default tolerance to use when testing values that are close together. Read more

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool[src]

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool[src]

The inverse of AbsDiffEq::abs_diff_eq.

impl<T> Add<Complex<T>> for Complex<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, other: Self) -> Self[src]

Performs the + operation. Read more

impl<T> Add<Complex<T>> for Quaternion<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, other: Complex<T>) -> Self[src]

Performs the + operation. Read more

impl Add<Quaternion<f32>> for Complex<f32>[src]

Workaround for reverse addition.

type Output = Quaternion<f32>

The resulting type after applying the + operator.

fn add(self, other: Quaternion<f32>) -> Self::Output[src]

Performs the + operation. Read more

impl Add<Quaternion<f64>> for Complex<f64>[src]

Workaround for reverse addition.

type Output = Quaternion<f64>

The resulting type after applying the + operator.

fn add(self, other: Quaternion<f64>) -> Self::Output[src]

Performs the + operation. Read more

impl<T> Add<T> for Complex<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, other: T) -> Self[src]

Performs the + operation. Read more

impl<T> AddAssign<Complex<T>> for Complex<T> where
    T: AddAssign
[src]

fn add_assign(&mut self, other: Self)[src]

Performs the += operation. Read more

impl<T> AddAssign<Complex<T>> for Quaternion<T> where
    T: AddAssign
[src]

fn add_assign(&mut self, other: Complex<T>)[src]

Performs the += operation. Read more

impl<T> AddAssign<T> for Complex<T> where
    T: AddAssign
[src]

fn add_assign(&mut self, other: T)[src]

Performs the += operation. Read more

impl<T: Clone> Clone for Complex<T>[src]

fn clone(&self) -> Complex<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Conj for Complex<T> where
    T: Neg<Output = T>, 
[src]

fn conj(self) -> Self[src]

Perform complex conjugation.

impl<T: Debug> Debug for Complex<T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter. Read more

impl<T: Default> Default for Complex<T>[src]

fn default() -> Complex<T>[src]

Returns the “default value” for a type. Read more

impl<T> Directional<Complex<T>> for Moebius<Complex<T>> where
    Self: Transform<Complex<T>>,
    Complex<T>: Normalize
[src]

fn apply_dir(&self, pos: Complex<T>, dir: Complex<T>) -> Complex<T>[src]

Returns the result of the direction transformation at the specified position.

fn apply_normal(&self, pos: Complex<T>, normal: Complex<T>) -> Complex<T>[src]

Returns the result of the normal transformation at the specified position. Read more

impl<T: Display> Display for Complex<T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult[src]

Formats the value using the given formatter. Read more

impl<T> Distribution<Complex<T>> for Normal where
    Normal: Distribution<Vector<T, 2>>, 
[src]

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Complex<T>[src]

Generate a random value of T, using rng as the source of randomness.

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<T: Float> Distribution<Complex<T>> for NonZero where
    NonZero: Distribution<Vector<T, 2>>, 
[src]

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Complex<T>[src]

Generate a random value of T, using rng as the source of randomness.

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<T: Float> Distribution<Complex<T>> for Unit where
    Unit: Distribution<Vector<T, 2>>, 
[src]

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Complex<T>[src]

Generate a random value of T, using rng as the source of randomness.

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<T> Div<Complex<T>> for Complex<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, other: Self) -> Self[src]

Performs the / operation. Read more

impl<T> Div<Complex<T>> for Quaternion<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, other: Complex<T>) -> Self[src]

Performs the / operation. Read more

impl<T> Div<Quaternion<T>> for Complex<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Quaternion<T>

The resulting type after applying the / operator.

fn div(self, other: Quaternion<T>) -> Self::Output[src]

Performs the / operation. Read more

impl<T> Div<T> for Complex<T> where
    T: Div<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, other: T) -> Self[src]

Performs the / operation. Read more

impl<T> DivAssign<Complex<T>> for Complex<T> where
    Self: Div<Output = Self> + Copy
[src]

fn div_assign(&mut self, other: Self)[src]

Performs the /= operation. Read more

impl<T> DivAssign<Complex<T>> for Quaternion<T> where
    Self: Div<Complex<T>, Output = Self> + Copy
[src]

fn div_assign(&mut self, other: Complex<T>)[src]

Performs the /= operation. Read more

impl<T> DivAssign<T> for Complex<T> where
    Self: Div<T, Output = Self> + Copy
[src]

fn div_assign(&mut self, other: T)[src]

Performs the /= operation. Read more

impl<T> Dot<Complex<T>> for Complex<T> where
    T: Add<Output = T> + Mul<Output = T>, 
[src]

type Output = T

Dot product output type.

fn dot(self, other: Self) -> T[src]

Perform dot product.

impl<T> From<[T; 2]> for Complex<T>[src]

fn from(arr: [T; 2]) -> Self[src]

Performs the conversion.

impl<T> From<(T, T)> for Complex<T>[src]

fn from(tup: (T, T)) -> Self[src]

Performs the conversion.

impl<T> From<Complex<T>> for Vector2<T>[src]

fn from(comp: Complex<T>) -> Self[src]

Performs the conversion.

impl<T> From<Complex<T>> for Complex<T>[src]

fn from(nc: NumComplex<T>) -> Self[src]

Performs the conversion.

impl<T> From<Complex<T>> for Rotation2<T>[src]

fn from(comp: Complex<T>) -> Self[src]

Performs the conversion.

impl<T> From<Rotation2<T>> for Complex<T>[src]

fn from(rot: Rotation2<T>) -> Self[src]

Performs the conversion.

impl<T> From<Vector<T, 2_usize>> for Complex<T>[src]

fn from(vec: Vector2<T>) -> Self[src]

Performs the conversion.

impl<T> Inv for Complex<T> where
    T: Float
[src]

type Output = Self

The result after applying the operator.

fn inv(self) -> Self[src]

Returns the multiplicative inverse of self. Read more

impl<T> Mul<Complex<T>> for Complex<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: Self) -> Self[src]

Performs the * operation. Read more

impl<T> Mul<Complex<T>> for Quaternion<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: Complex<T>) -> Self[src]

Performs the * operation. Read more

impl<T> Mul<Quaternion<T>> for Complex<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Quaternion<T>

The resulting type after applying the * operator.

fn mul(self, other: Quaternion<T>) -> Self::Output[src]

Performs the * operation. Read more

impl<T> Mul<T> for Complex<T> where
    T: Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: T) -> Self[src]

Performs the * operation. Read more

impl<T> MulAssign<Complex<T>> for Complex<T> where
    Self: Mul<Output = Self> + Copy
[src]

fn mul_assign(&mut self, other: Self)[src]

Performs the *= operation. Read more

impl<T> MulAssign<Complex<T>> for Quaternion<T> where
    Self: Mul<Complex<T>, Output = Self> + Copy
[src]

fn mul_assign(&mut self, other: Complex<T>)[src]

Performs the *= operation. Read more

impl<T> MulAssign<T> for Complex<T> where
    Self: Mul<T, Output = Self> + Copy
[src]

fn mul_assign(&mut self, other: T)[src]

Performs the *= operation. Read more

impl<T> Neg for Complex<T> where
    T: Neg<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

fn neg(self) -> Self[src]

Performs the unary - operation. Read more

impl<T> NormL1 for Complex<T> where
    Vector2<T>: NormL1<Output = T>, 
[src]

type Output = T

Type of the norm.

fn norm_l1(self) -> T[src]

Norm of the element.

impl<T: Float> NormL2 for Complex<T>[src]

type Output = T

Type of the norm.

fn norm_l2(self) -> T[src]

Norm of the element.

fn norm_l2_sqr(self) -> T[src]

Square norm of the element.

impl<T> Normalize for Complex<T> where
    T: Float
[src]

fn normalize(self) -> Self[src]

Normalize object.

impl<T: Neg<Output = T> + Num + Copy> Num for Complex<T>[src]

type FromStrRadixErr = ParseComplexError<T::FromStrRadixErr>

fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>[src]

Convert from a string and radix (typically 2..=36). Read more

impl<T> One for Complex<T> where
    T: Zero + One + Sub<Output = T> + Copy
[src]

fn one() -> Self[src]

Returns the multiplicative identity element of Self, 1. Read more

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

impl<T: PartialEq> PartialEq<Complex<T>> for Complex<T>[src]

fn eq(&self, other: &Complex<T>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Complex<T>) -> bool[src]

This method tests for !=.

impl<T: Neg<Output = T> + Num + Copy> Rem<Complex<T>> for Complex<T>[src]

type Output = Self

The resulting type after applying the % operator.

fn rem(self, other: Self) -> Self[src]

Performs the % operation. Read more

impl<T> Sub<Complex<T>> for Complex<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, other: Self) -> Self[src]

Performs the - operation. Read more

impl<T> Sub<Complex<T>> for Quaternion<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, other: Complex<T>) -> Self[src]

Performs the - operation. Read more

impl Sub<Quaternion<f32>> for Complex<f32>[src]

Workaround for reverse subtraction.

type Output = Quaternion<f32>

The resulting type after applying the - operator.

fn sub(self, other: Quaternion<f32>) -> Self::Output[src]

Performs the - operation. Read more

impl Sub<Quaternion<f64>> for Complex<f64>[src]

Workaround for reverse subtraction.

type Output = Quaternion<f64>

The resulting type after applying the - operator.

fn sub(self, other: Quaternion<f64>) -> Self::Output[src]

Performs the - operation. Read more

impl<T> Sub<T> for Complex<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, other: T) -> Self[src]

Performs the - operation. Read more

impl<T> SubAssign<Complex<T>> for Complex<T> where
    T: SubAssign
[src]

fn sub_assign(&mut self, other: Self)[src]

Performs the -= operation. Read more

impl<T> SubAssign<Complex<T>> for Quaternion<T> where
    T: SubAssign
[src]

fn sub_assign(&mut self, other: Complex<T>)[src]

Performs the -= operation. Read more

impl<T> SubAssign<T> for Complex<T> where
    T: SubAssign
[src]

fn sub_assign(&mut self, other: T)[src]

Performs the -= operation. Read more

impl<T> Transform<Complex<T>> for Moebius<Complex<T>> where
    T: Neg<Output = T> + Num + Copy
[src]

fn identity() -> Self[src]

Identity transformation.

fn inv(self) -> Self[src]

Inverse transformation.

fn apply(&self, pos: Complex<T>) -> Complex<T>[src]

Perform the transformation itself.

fn deriv(&self, pos: Complex<T>, dir: Complex<T>) -> Complex<T>[src]

Find transformation directional derivative at specified point.

fn chain(self, other: Self) -> Self[src]

Chain two transformations into a new one. Read more

impl<T> Zero for Complex<T> where
    T: Zero
[src]

fn zero() -> Self[src]

Returns the additive identity element of Self, 0. Read more

fn is_zero(&self) -> bool[src]

Returns true if self is equal to the additive identity.

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<T: Copy> Copy for Complex<T>[src]

impl<T> StructuralPartialEq for Complex<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Complex<T> where
    T: RefUnwindSafe

impl<T> Send for Complex<T> where
    T: Send

impl<T> Sync for Complex<T> where
    T: Sync

impl<T> Unpin for Complex<T> where
    T: Unpin

impl<T> UnwindSafe for Complex<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]