[][src]Struct quest_rs::Complex

pub struct Complex {
    pub real: QReal,
    pub imag: QReal,
}

Represents one complex number.

Examples

use quest_rs::Complex;

let alpha = Complex::new(0.4, 0.6);
assert_eq!(alpha.real, 0.4);
assert_eq!(alpha.imag, 0.6);

let beta = Complex::real(1.2);
assert_eq!(beta.real, 1.2);
assert_eq!(beta.imag, 0.0);

let gamma = Complex::imag(23.9);
assert_eq!(gamma.real, 0.0);
assert_eq!(gamma.imag, 23.9);

let zero = Complex::zero();
assert_eq!(zero.real, 0.0);
assert_eq!(zero.imag, 0.0);

Fields

real: QRealimag: QReal

Methods

impl Complex[src]

pub fn new(real: QReal, imag: QReal) -> Self[src]

Create a new complex number based on the real and imaginary values.

pub fn real(real: QReal) -> Self[src]

pub fn imag(imag: QReal) -> Self[src]

pub fn zero() -> Self[src]

Trait Implementations

impl Clone for Complex[src]

impl Copy for Complex[src]

impl Debug for Complex[src]

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

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.