Struct rgsl::types::complex::ComplexF64 [] [src]

pub struct ComplexF64 {
    pub data: [f64; 2],
}

Fields

data: [f64; 2]

Methods

impl ComplexF64
[src]

fn rect(x: f64, y: f64) -> ComplexF64

This function uses the rectangular Cartesian components (x,y) to return the complex number z = x + i y.

fn polar(r: f64, theta: f64) -> ComplexF64

This function returns the complex number z = r \exp(i \theta) = r (\cos(\theta) + i \sin(\theta)) from the polar representation (r,theta).

fn arg(&self) -> f64

This function returns the argument of the complex number z, \arg(z), where -\pi < \arg(z) <= \pi.

fn abs(&self) -> f64

This function returns the magnitude of the complex number z, |z|.

fn abs2(&self) -> f64

This function returns the squared magnitude of the complex number z, |z|2.

fn logabs(&self) -> f64

This function returns the natural logarithm of the magnitude of the complex number z, \log|z|. It allows an accurate evaluation of \log|z| when |z| is close to one. The direct evaluation of log(gsl_complex_abs(z)) would lead to a loss of precision in this case.

fn add(&self, other: &ComplexF64) -> ComplexF64

This function returns the sum of the complex numbers a and b, z=a+b.

fn sub(&self, other: &ComplexF64) -> ComplexF64

This function returns the difference of the complex numbers a and b, z=a-b.

fn mul(&self, other: &ComplexF64) -> ComplexF64

This function returns the product of the complex numbers a and b, z=ab.

fn div(&self, other: &ComplexF64) -> ComplexF64

This function returns the quotient of the complex numbers a and b, z=a/b.

fn add_real(&self, x: f64) -> ComplexF64

This function returns the sum of the complex number a and the real number x, z=a+x.

fn sub_real(&self, x: f64) -> ComplexF64

This function returns the difference of the complex number a and the real number x, z=a-x.

fn mul_real(&self, x: f64) -> ComplexF64

This function returns the product of the complex number a and the real number x, z=ax.

fn div_real(&self, x: f64) -> ComplexF64

This function returns the quotient of the complex number a and the real number x, z=a/x.

fn add_imag(&self, x: f64) -> ComplexF64

This function returns the sum of the complex number a and the imaginary number iy, z=a+iy.

fn sub_imag(&self, x: f64) -> ComplexF64

This function returns the difference of the complex number a and the imaginary number iy, z=a-iy.

fn mul_imag(&self, x: f64) -> ComplexF64

This function returns the product of the complex number a and the imaginary number iy, z=a*(iy).

fn div_imag(&self, x: f64) -> ComplexF64

This function returns the quotient of the complex number a and the imaginary number iy, z=a/(iy).

fn conjugate(&self) -> ComplexF64

This function returns the complex conjugate of the complex number z, z* = x - i y.

fn inverse(&self) -> ComplexF64

This function returns the inverse, or reciprocal, of the complex number z, 1/z = (x - i y)/(x2 + y2).

fn negative(&self) -> ComplexF64

This function returns the negative of the complex number z, -z = (-x) + i(-y).

fn sqrt(&self) -> ComplexF64

This function returns the square root of the complex number z, \sqrt z. The branch cut is the negative real axis. The result always lies in the right half of the complex plane.

fn sqrt_real(x: f64) -> ComplexF64

This function returns the complex square root of the real number x, where x may be negative.

fn pow(&self, other: &ComplexF64) -> ComplexF64

The function returns the complex number z raised to the complex power a, za. This is computed as \exp(\log(z)*a) using complex logarithms and complex exponentials.

fn pow_real(&self, x: f64) -> ComplexF64

This function returns the complex number z raised to the real power x, zx.

fn exp(&self) -> ComplexF64

This function returns the complex exponential of the complex number z, \exp(z).

fn log(&self) -> ComplexF64

This function returns the complex natural logarithm (base e) of the complex number z, \log(z). The branch cut is the negative real axis.

fn log10(&self) -> ComplexF64

This function returns the complex base-10 logarithm of the complex number z, \log_10 (z).

fn log_b(&self, other: &ComplexF64) -> ComplexF64

This function returns the complex base-b logarithm of the complex number z, \log_b(z). This quantity is computed as the ratio \log(z)/\log(b).

fn sin(&self) -> ComplexF64

This function returns the complex sine of the complex number z, \sin(z) = (\exp(iz) - \exp(-iz))/(2i).

fn cos(&self) -> ComplexF64

This function returns the complex cosine of the complex number z, \cos(z) = (\exp(iz) + \exp(-iz))/2.

fn tan(&self) -> ComplexF64

This function returns the complex tangent of the complex number z, \tan(z) = \sin(z)/\cos(z).

fn sec(&self) -> ComplexF64

This function returns the complex secant of the complex number z, \sec(z) = 1/\cos(z).

fn csc(&self) -> ComplexF64

This function returns the complex cosecant of the complex number z, \csc(z) = 1/\sin(z).

fn cot(&self) -> ComplexF64

This function returns the complex cotangent of the complex number z, \cot(z) = 1/\tan(z).

fn arcsin(&self) -> ComplexF64

This function returns the complex arcsine of the complex number z, \arcsin(z). The branch cuts are on the real axis, less than -1 and greater than 1.

fn arcsin_real(z: f64) -> ComplexF64

This function returns the complex arcsine of the real number z, \arcsin(z).

  • For z between -1 and 1, the function returns a real value in the range [-\pi/2,\pi/2].
  • For z less than -1 the result has a real part of -\pi/2 and a positive imaginary part.
  • For z greater than 1 the result has a real part of \pi/2 and a negative imaginary part.

fn arccos(&self) -> ComplexF64

This function returns the complex arccosine of the complex number z, \arccos(z). The branch cuts are on the real axis, less than -1 and greater than 1.

fn arccos_real(z: f64) -> ComplexF64

This function returns the complex arccosine of the real number z, \arccos(z).

  • For z between -1 and 1, the function returns a real value in the range [0,\pi].
  • For z less than -1 the result has a real part of \pi and a negative imaginary part.
  • For z greater than 1 the result is purely imaginary and positive.

fn arctan(&self) -> ComplexF64

This function returns the complex arctangent of the complex number z, \arctan(z). The branch cuts are on the imaginary axis, below -i and above i.

fn arcsec(&self) -> ComplexF64

This function returns the complex arcsecant of the complex number z, \arcsec(z) = \arccos(1/z).

fn arcsec_real(z: f64) -> ComplexF64

This function returns the complex arcsecant of the real number z, \arcsec(z) = \arccos(1/z).

fn arccsc(&self) -> ComplexF64

This function returns the complex arccosecant of the complex number z, \arccsc(z) = \arcsin(1/z).

fn arccsc_real(z: f64) -> ComplexF64

This function returns the complex arccosecant of the real number z, \arccsc(z) = \arcsin(1/z).

fn arccot(&self) -> ComplexF64

This function returns the complex arccotangent of the complex number z, \arccot(z) = \arctan(1/z).

fn sinh(&self) -> ComplexF64

This function returns the complex hyperbolic sine of the complex number z, \sinh(z) = (\exp(z) - \exp(-z))/2.

fn cosh(&self) -> ComplexF64

This function returns the complex hyperbolic cosine of the complex number z, \cosh(z) = (\exp(z) + \exp(-z))/2.

fn tanh(&self) -> ComplexF64

This function returns the complex hyperbolic tangent of the complex number z, \tanh(z) = \sinh(z)/\cosh(z).

fn sech(&self) -> ComplexF64

This function returns the complex hyperbolic secant of the complex number z, \sech(z) = 1/\cosh(z).

fn csch(&self) -> ComplexF64

This function returns the complex hyperbolic cosecant of the complex number z, \csch(z) = 1/\sinh(z).

fn coth(&self) -> ComplexF64

This function returns the complex hyperbolic cotangent of the complex number z, \coth(z) = 1/\tanh(z).

fn arcsinh(&self) -> ComplexF64

This function returns the complex hyperbolic arcsine of the complex number z, \arcsinh(z). The branch cuts are on the imaginary axis, below -i and above i.

fn arccosh(&self) -> ComplexF64

This function returns the complex hyperbolic arccosine of the complex number z, \arccosh(z). The branch cut is on the real axis, less than 1. Note that in this case we use the negative square root in formula 4.6.21 of Abramowitz & Stegun giving \arccosh(z)=\log(z-\sqrt{z2-1}).

fn arccosh_real(z: f64) -> ComplexF64

This function returns the complex hyperbolic arccosine of the real number z, \arccosh(z).

fn arctanh(&self) -> ComplexF64

This function returns the complex hyperbolic arctangent of the complex number z, \arctanh(z). The branch cuts are on the real axis, less than -1 and greater than 1.

fn arctanh_real(z: f64) -> ComplexF64

This function returns the complex hyperbolic arctangent of the real number z, \arctanh(z).

fn arcsech(&self) -> ComplexF64

This function returns the complex hyperbolic arcsecant of the complex number z, \arcsech(z) = \arccosh(1/z).

fn arccsch(&self) -> ComplexF64

This function returns the complex hyperbolic arccosecant of the complex number z, \arccsch(z) = \arcsin(1/z).

fn arccoth(&self) -> ComplexF64

This function returns the complex hyperbolic arccotangent of the complex number z, \arccoth(z) = \arctanh(1/z).

Trait Implementations

impl Copy for ComplexF64
[src]

impl Debug for ComplexF64
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for ComplexF64
[src]

fn clone(&self) -> ComplexF64

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Default for ComplexF64
[src]

fn default() -> ComplexF64

Returns the "default value" for a type. Read more