[−][src]Struct quest_rs::Complex
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: QReal
imag: 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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,