Struct easy_complex::Complex
[−]
[src]
pub struct Complex { pub real: f64, pub imag: f64, }
Complex number in the usual form (a + b*i)
Fields
real: f64
imag: f64
Methods
impl Complex
[src]
pub fn new() -> Complex
[src]
pub fn new_from(f: &EComplex) -> Complex
[src]
pub fn real(&self) -> f64
[src]
Return real part
pub fn imag(&self) -> f64
[src]
Return imaginary part
pub fn module(&self) -> f64
[src]
Return module of equivalent EComplex
pub fn arg(&self) -> f64
[src]
Return argument of equivalent EComplex in radians
pub fn argd(&self) -> f64
[src]
Return argument of equivalent EComplex in degrees
pub fn sqrt(&self) -> Result<Vec<EComplex>, &'static str>
[src]
Return vector of the two square roots
pub fn root(&self, r: usize) -> Result<Vec<EComplex>, &'static str>
[src]
Return vector of size n
with the n
th roots
pub fn powi(&self, p: isize) -> Complex
[src]
Return the number raised to the power p
pub fn powf(&self, p: f64) -> Complex
[src]
Return the number raised to the power p
pub fn conjugate(&self) -> Complex
[src]
Return the conjugate Complex
pub fn abs(&self) -> f64
[src]
Return the module
pub fn exp(&self) -> Complex
[src]
Return e^(self)
pub fn ln(&self) -> Complex
[src]
Return ln(self)
pub fn log(&self, b: f64) -> Complex
[src]
Return log(self)
in the base b
pub fn inverse(&self) -> Complex
[src]
Return 1/self
pub fn cos(&self) -> Complex
[src]
Return the cosine
pub fn sin(&self) -> Complex
[src]
Return the sine
pub fn tan(&self) -> Option<Complex>
[src]
Return the tangent
pub fn cosh(&self) -> Complex
[src]
Return the hyperbolic cosine
pub fn sinh(&self) -> Complex
[src]
Return the hyperbolic sine
pub fn tanh(&self) -> Complex
[src]
Return the hyperbolic tangent
pub fn tuple(&self) -> (f64, f64)
[src]
Return the real and imaginary parts as a tuple (real, imag)
pub fn exp_tuple(&self) -> (f64, f64)
[src]
Return as a tuple the module and argument of the equivalent EComplex (mod, arg)
Trait Implementations
impl Debug for Complex
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Complex
[src]
fn clone(&self) -> Complex
[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 Copy for Complex
[src]
impl ComplexNumber for Complex
[src]
impl From<EComplex> for Complex
[src]
impl From<Complex> for EComplex
[src]
impl Display for Complex
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq<Complex> for EComplex
[src]
fn eq(&self, other: &Complex) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Complex) -> bool
[src]
This method tests for !=
.
impl PartialEq<EComplex> for Complex
[src]
fn eq(&self, other: &EComplex) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &EComplex) -> bool
[src]
This method tests for !=
.
impl PartialEq for Complex
[src]
fn eq(&self, other: &Complex) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Complex) -> bool
[src]
This method tests for !=
.
impl Add<Complex> for EComplex
[src]
type Output = EComplex
The resulting type after applying the +
operator.
fn add(self, other: Complex) -> EComplex
[src]
Performs the +
operation.
impl<'a, 'b> Add<&'b Complex> for &'a EComplex
[src]
type Output = EComplex
The resulting type after applying the +
operator.
fn add(self, other: &'b Complex) -> EComplex
[src]
Performs the +
operation.
impl Add<Complex> for Complex
[src]
type Output = Complex
The resulting type after applying the +
operator.
fn add(self, other: Complex) -> Complex
[src]
Performs the +
operation.
impl<'a, 'b> Add<&'b Complex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the +
operator.
fn add(self, other: &'b Complex) -> Complex
[src]
Performs the +
operation.
impl Add<EComplex> for Complex
[src]
type Output = Complex
The resulting type after applying the +
operator.
fn add(self, other: EComplex) -> Complex
[src]
Performs the +
operation.
impl<'a, 'b> Add<&'b EComplex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the +
operator.
fn add(self, other: &'b EComplex) -> Complex
[src]
Performs the +
operation.
impl Neg for Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn neg(self) -> Complex
[src]
Performs the unary -
operation.
impl<'a> Neg for &'a Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn neg(self) -> Complex
[src]
Performs the unary -
operation.
impl Sub<Complex> for EComplex
[src]
type Output = EComplex
The resulting type after applying the -
operator.
fn sub(self, other: Complex) -> EComplex
[src]
Performs the -
operation.
impl<'a, 'b> Sub<&'b Complex> for &'a EComplex
[src]
type Output = EComplex
The resulting type after applying the -
operator.
fn sub(self, other: &'b Complex) -> EComplex
[src]
Performs the -
operation.
impl Sub<EComplex> for Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn sub(self, other: EComplex) -> Complex
[src]
Performs the -
operation.
impl<'a, 'b> Sub<&'b EComplex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn sub(self, other: &'b EComplex) -> Complex
[src]
Performs the -
operation.
impl Sub<Complex> for Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn sub(self, other: Complex) -> Complex
[src]
Performs the -
operation.
impl<'a, 'b> Sub<&'b Complex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the -
operator.
fn sub(self, other: &'b Complex) -> Complex
[src]
Performs the -
operation.
impl Mul<Complex> for EComplex
[src]
type Output = EComplex
The resulting type after applying the *
operator.
fn mul(self, other: Complex) -> EComplex
[src]
Performs the *
operation.
impl<'a, 'b> Mul<&'b Complex> for &'a EComplex
[src]
type Output = EComplex
The resulting type after applying the *
operator.
fn mul(self, other: &'b Complex) -> EComplex
[src]
Performs the *
operation.
impl Mul<Complex> for Complex
[src]
type Output = Complex
The resulting type after applying the *
operator.
fn mul(self, other: Complex) -> Complex
[src]
Performs the *
operation.
impl<'a, 'b> Mul<&'b Complex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the *
operator.
fn mul(self, other: &'b Complex) -> Complex
[src]
Performs the *
operation.
impl Mul<EComplex> for Complex
[src]
type Output = Complex
The resulting type after applying the *
operator.
fn mul(self, other: EComplex) -> Complex
[src]
Performs the *
operation.
impl<'a, 'b> Mul<&'b EComplex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the *
operator.
fn mul(self, other: &'b EComplex) -> Complex
[src]
Performs the *
operation.
impl Div<Complex> for EComplex
[src]
type Output = EComplex
The resulting type after applying the /
operator.
fn div(self, other: Complex) -> EComplex
[src]
Performs the /
operation.
impl<'a, 'b> Div<&'b Complex> for &'a EComplex
[src]
type Output = EComplex
The resulting type after applying the /
operator.
fn div(self, other: &'b Complex) -> EComplex
[src]
Performs the /
operation.
impl Div<Complex> for Complex
[src]
type Output = Complex
The resulting type after applying the /
operator.
fn div(self, other: Complex) -> Complex
[src]
Performs the /
operation.
impl<'a, 'b> Div<&'b Complex> for &'a Complex
[src]
type Output = Complex
The resulting type after applying the /
operator.
fn div(self, other: &'b Complex) -> Complex
[src]
Performs the /
operation.
impl Div<EComplex> for Complex
[src]
type Output = Complex
The resulting type after applying the /
operator.
fn div(self, other: EComplex) -> Complex
[src]
Performs the /
operation.