-
Notifications
You must be signed in to change notification settings - Fork 0
EComplex
EComplex is a struct representation of a complex number in the exponential form
module * e ^ ( argument*i )
Method:
new() -> EComplexTakes no arguments, returns a EComplex with value 0 * e ^ (0 * i)
Method:
new_from(&Complex) -> EComplexTakes a reference to a Complex number, returns an equivalent EComplex
Can be considered to be a cast or transformation between types
It is a static method
Method:
real(&self) -> f64Takes no arguments, returns the real part of the equivalent Complex number
Method:
imag(&self) -> f64Takes no arguments, returns the imaginary part of the equivalent Complex number
Method:
argd(&self) -> f64Takes no arguments, returns the argument (angle) of the number in degrees
Method:
sqrt(&self) -> Result<Vec<EComplex>, &'static str>Takes no arguments, returns the two square roots of the number
Method:
root(&self, n: usize) -> Result<Vec<EComplex>, &'static str>Takes a usize, returns n possible nth roots of a number or a string error if it fails.
Method:
powi(&self, p: isize) -> EComplexTakes an isize, returns the number to the power of p
Method:
powf(&self, p: f64) -> EComplexTakes a 64 bit float, returns the number to the power of p
It uses a 64 bit float to reduce inaccuracies
Method:
conjugate(&self) -> EComplexTakes no arguments, returns the conjugate Complex number
Method:
abs(&self) -> f64Takes no arguments, returns the absolute value of the module of the number
Method:
exp(&self) -> EComplexTakes no arguments, returns the result of elevating e to the complex number
Method:
ln(&self) -> EComplexTakes no arguments, return the main logarithm of the number
Method:
log(&self, b: f64) -> EComplexTakes a 64 bit float, returns the logarithm in base b of the number
Method:
inverse(&self) -> EComplexTakes no arguments, returns one divided by the number (1/number)
Method:
cos(&self) -> EComplexTakes no arguments, returns the cosine of the number
Method:
sin(&self) -> EComplexTakes no arguments, returns the sine of the number
Method:
tan(&self) -> Option<EComplex>Takes no arguments, returns the tangent of the number or None if it tends to infinity
Method:
cosh(&self) -> EComplexTakes no arguments, returns the hyperbolic cosine of the number
Method:
sinh(&self) -> EComplexTakes no arguments, returns the hyperbolic sine of the number
Method:
tuple(&self) -> (f64, f64)Takes no arguments, returns the module and argument of the number as a tuple (real, imag)
Method:
c_tuple(&self) -> (f64, f64)Takes no arguments, returns the real part and imaginary part of the equivalent Complex