Trait heron::rapier_plugin::rapier::parry::na::ComplexField [−]
pub trait ComplexField: 'static + SubsetOf<Self> + SupersetOf<f64> + Field<Element = Self, SimdBool = bool, Output = Self> + Copy + Neg + Send + Sync + Any + Debug + FromPrimitive + Display { type RealField: RealField;}Show methods
pub fn from_real(re: Self::RealField) -> Self; pub fn real(self) -> Self::RealField; pub fn imaginary(self) -> Self::RealField; pub fn modulus(self) -> Self::RealField; pub fn modulus_squared(self) -> Self::RealField; pub fn argument(self) -> Self::RealField; pub fn norm1(self) -> Self::RealField; pub fn scale(self, factor: Self::RealField) -> Self; pub fn unscale(self, factor: Self::RealField) -> Self; pub fn floor(self) -> Self; pub fn ceil(self) -> Self; pub fn round(self) -> Self; pub fn trunc(self) -> Self; pub fn fract(self) -> Self; pub fn mul_add(self, a: Self, b: Self) -> Self; pub fn abs(self) -> Self::RealField; pub fn hypot(self, other: Self) -> Self::RealField; pub fn recip(self) -> Self; pub fn conjugate(self) -> Self; pub fn sin(self) -> Self; pub fn cos(self) -> Self; pub fn sin_cos(self) -> (Self, Self); pub fn tan(self) -> Self; pub fn asin(self) -> Self; pub fn acos(self) -> Self; pub fn atan(self) -> Self; pub fn sinh(self) -> Self; pub fn cosh(self) -> Self; pub fn tanh(self) -> Self; pub fn asinh(self) -> Self; pub fn acosh(self) -> Self; pub fn atanh(self) -> Self; pub fn log(self, base: Self::RealField) -> Self; pub fn log2(self) -> Self; pub fn log10(self) -> Self; pub fn ln(self) -> Self; pub fn ln_1p(self) -> Self; pub fn sqrt(self) -> Self; pub fn exp(self) -> Self; pub fn exp2(self) -> Self; pub fn exp_m1(self) -> Self; pub fn powi(self, n: i32) -> Self; pub fn powf(self, n: Self::RealField) -> Self; pub fn powc(self, n: Self) -> Self; pub fn cbrt(self) -> Self; pub fn is_finite(&self) -> bool; pub fn try_sqrt(self) -> Option<Self>; pub fn to_polar(self) -> (Self::RealField, Self::RealField) { ... } pub fn to_exp(self) -> (Self::RealField, Self) { ... } pub fn signum(self) -> Self { ... } pub fn sinh_cosh(self) -> (Self, Self) { ... } pub fn sinc(self) -> Self { ... } pub fn sinhc(self) -> Self { ... } pub fn cosc(self) -> Self { ... } pub fn coshc(self) -> Self { ... }
Trait shared by all complex fields and its subfields (like real numbers).
Complex numbers are equipped with functions that are commonly used on complex numbers and reals. The results of those functions only have to be approximately equal to the actual theoretical values.
Associated Types
Loading content...Required methods
pub fn from_real(re: Self::RealField) -> Self
Builds a pure-real complex number from the given value.
pub fn real(self) -> Self::RealField
The real part of this complex number.
pub fn imaginary(self) -> Self::RealField
The imaginary part of this complex number.
pub fn modulus(self) -> Self::RealField
The modulus of this complex number.
pub fn modulus_squared(self) -> Self::RealField
The squared modulus of this complex number.
pub fn argument(self) -> Self::RealField
The argument of this complex number.
pub fn norm1(self) -> Self::RealField
The sum of the absolute value of this complex number’s real and imaginary part.
pub fn scale(self, factor: Self::RealField) -> Self
Multiplies this complex number by factor
.
pub fn unscale(self, factor: Self::RealField) -> Self
Divides this complex number by factor
.
pub fn floor(self) -> Self
pub fn ceil(self) -> Self
pub fn round(self) -> Self
pub fn trunc(self) -> Self
pub fn fract(self) -> Self
pub fn mul_add(self, a: Self, b: Self) -> Self
pub fn abs(self) -> Self::RealField
The absolute value of this complex number: self / self.signum()
.
This is equivalent to self.modulus()
.
pub fn hypot(self, other: Self) -> Self::RealField
Computes (self.conjugate() * self + other.conjugate() * other).sqrt()
pub fn recip(self) -> Self
pub fn conjugate(self) -> Self
pub fn sin(self) -> Self
pub fn cos(self) -> Self
pub fn sin_cos(self) -> (Self, Self)
pub fn tan(self) -> Self
pub fn asin(self) -> Self
pub fn acos(self) -> Self
pub fn atan(self) -> Self
pub fn sinh(self) -> Self
pub fn cosh(self) -> Self
pub fn tanh(self) -> Self
pub fn asinh(self) -> Self
pub fn acosh(self) -> Self
pub fn atanh(self) -> Self
pub fn log(self, base: Self::RealField) -> Self
pub fn log2(self) -> Self
pub fn log10(self) -> Self
pub fn ln(self) -> Self
pub fn ln_1p(self) -> Self
pub fn sqrt(self) -> Self
pub fn exp(self) -> Self
pub fn exp2(self) -> Self
pub fn exp_m1(self) -> Self
pub fn powi(self, n: i32) -> Self
pub fn powf(self, n: Self::RealField) -> Self
pub fn powc(self, n: Self) -> Self
pub fn cbrt(self) -> Self
pub fn is_finite(&self) -> bool
pub fn try_sqrt(self) -> Option<Self>
Provided methods
pub fn to_polar(self) -> (Self::RealField, Self::RealField)
The polar form of this complex number: (modulus, arg)
pub fn to_exp(self) -> (Self::RealField, Self)
The exponential form of this complex number: (modulus, e^{i arg})
pub fn signum(self) -> Self
The exponential part of this complex number: self / self.modulus()
pub fn sinh_cosh(self) -> (Self, Self)
pub fn sinc(self) -> Self
Cardinal sine
pub fn sinhc(self) -> Self
pub fn cosc(self) -> Self
Cardinal cos
pub fn coshc(self) -> Self
Implementations on Foreign Types
impl ComplexField for f32
type RealField = f32
pub fn from_real(re: <f32 as ComplexField>::RealField) -> f32
pub fn real(self) -> <f32 as ComplexField>::RealField
pub fn imaginary(self) -> <f32 as ComplexField>::RealField
pub fn norm1(self) -> <f32 as ComplexField>::RealField
pub fn modulus(self) -> <f32 as ComplexField>::RealField
pub fn modulus_squared(self) -> <f32 as ComplexField>::RealField
pub fn argument(self) -> <f32 as ComplexField>::RealField
pub fn to_exp(self) -> (f32, f32)
pub fn recip(self) -> f32
pub fn conjugate(self) -> f32
pub fn scale(self, factor: <f32 as ComplexField>::RealField) -> f32
pub fn unscale(self, factor: <f32 as ComplexField>::RealField) -> f32
pub fn floor(self) -> f32
pub fn ceil(self) -> f32
pub fn round(self) -> f32
pub fn trunc(self) -> f32
pub fn fract(self) -> f32
pub fn abs(self) -> f32
pub fn signum(self) -> f32
pub fn mul_add(self, a: f32, b: f32) -> f32
pub fn powi(self, n: i32) -> f32
pub fn powf(self, n: f32) -> f32
pub fn powc(self, n: f32) -> f32
pub fn sqrt(self) -> f32
pub fn try_sqrt(self) -> Option<f32>
pub fn exp(self) -> f32
pub fn exp2(self) -> f32
pub fn exp_m1(self) -> f32
pub fn ln_1p(self) -> f32
pub fn ln(self) -> f32
pub fn log(self, base: f32) -> f32
pub fn log2(self) -> f32
pub fn log10(self) -> f32
pub fn cbrt(self) -> f32
pub fn hypot(self, other: f32) -> <f32 as ComplexField>::RealField
pub fn sin(self) -> f32
pub fn cos(self) -> f32
pub fn tan(self) -> f32
pub fn asin(self) -> f32
pub fn acos(self) -> f32
pub fn atan(self) -> f32
pub fn sin_cos(self) -> (f32, f32)
pub fn sinh(self) -> f32
pub fn cosh(self) -> f32
pub fn tanh(self) -> f32
pub fn asinh(self) -> f32
pub fn acosh(self) -> f32
pub fn atanh(self) -> f32
pub fn is_finite(&self) -> bool
impl ComplexField for f64
type RealField = f64
pub fn from_real(re: <f64 as ComplexField>::RealField) -> f64
pub fn real(self) -> <f64 as ComplexField>::RealField
pub fn imaginary(self) -> <f64 as ComplexField>::RealField
pub fn norm1(self) -> <f64 as ComplexField>::RealField
pub fn modulus(self) -> <f64 as ComplexField>::RealField
pub fn modulus_squared(self) -> <f64 as ComplexField>::RealField
pub fn argument(self) -> <f64 as ComplexField>::RealField
pub fn to_exp(self) -> (f64, f64)
pub fn recip(self) -> f64
pub fn conjugate(self) -> f64
pub fn scale(self, factor: <f64 as ComplexField>::RealField) -> f64
pub fn unscale(self, factor: <f64 as ComplexField>::RealField) -> f64
pub fn floor(self) -> f64
pub fn ceil(self) -> f64
pub fn round(self) -> f64
pub fn trunc(self) -> f64
pub fn fract(self) -> f64
pub fn abs(self) -> f64
pub fn signum(self) -> f64
pub fn mul_add(self, a: f64, b: f64) -> f64
pub fn powi(self, n: i32) -> f64
pub fn powf(self, n: f64) -> f64
pub fn powc(self, n: f64) -> f64
pub fn sqrt(self) -> f64
pub fn try_sqrt(self) -> Option<f64>
pub fn exp(self) -> f64
pub fn exp2(self) -> f64
pub fn exp_m1(self) -> f64
pub fn ln_1p(self) -> f64
pub fn ln(self) -> f64
pub fn log(self, base: f64) -> f64
pub fn log2(self) -> f64
pub fn log10(self) -> f64
pub fn cbrt(self) -> f64
pub fn hypot(self, other: f64) -> <f64 as ComplexField>::RealField
pub fn sin(self) -> f64
pub fn cos(self) -> f64
pub fn tan(self) -> f64
pub fn asin(self) -> f64
pub fn acos(self) -> f64
pub fn atan(self) -> f64
pub fn sin_cos(self) -> (f64, f64)
pub fn sinh(self) -> f64
pub fn cosh(self) -> f64
pub fn tanh(self) -> f64
pub fn asinh(self) -> f64
pub fn acosh(self) -> f64
pub fn atanh(self) -> f64
pub fn is_finite(&self) -> bool
Implementors
impl<N> ComplexField for Complex<N> where
N: RealField + PartialOrd<N>,
N: RealField + PartialOrd<N>,
type RealField = N
pub fn from_real(re: <Complex<N> as ComplexField>::RealField) -> Complex<N>
pub fn real(self) -> <Complex<N> as ComplexField>::RealField
pub fn imaginary(self) -> <Complex<N> as ComplexField>::RealField
pub fn argument(self) -> <Complex<N> as ComplexField>::RealField
pub fn modulus(self) -> <Complex<N> as ComplexField>::RealField
pub fn modulus_squared(self) -> <Complex<N> as ComplexField>::RealField
pub fn norm1(self) -> <Complex<N> as ComplexField>::RealField
pub fn recip(self) -> Complex<N>
pub fn conjugate(self) -> Complex<N>
pub fn scale(
self,
factor: <Complex<N> as ComplexField>::RealField
) -> Complex<N>
self,
factor: <Complex<N> as ComplexField>::RealField
) -> Complex<N>
pub fn unscale(
self,
factor: <Complex<N> as ComplexField>::RealField
) -> Complex<N>
self,
factor: <Complex<N> as ComplexField>::RealField
) -> Complex<N>
pub fn floor(self) -> Complex<N>
pub fn ceil(self) -> Complex<N>
pub fn round(self) -> Complex<N>
pub fn trunc(self) -> Complex<N>
pub fn fract(self) -> Complex<N>
pub fn mul_add(self, a: Complex<N>, b: Complex<N>) -> Complex<N>
pub fn abs(self) -> <Complex<N> as ComplexField>::RealField
pub fn exp2(self) -> Complex<N>
pub fn exp_m1(self) -> Complex<N>
pub fn ln_1p(self) -> Complex<N>
pub fn log2(self) -> Complex<N>
pub fn log10(self) -> Complex<N>
pub fn cbrt(self) -> Complex<N>
pub fn powi(self, n: i32) -> Complex<N>
pub fn is_finite(&self) -> bool
pub fn exp(self) -> Complex<N>
Computes e^(self)
, where e
is the base of the natural logarithm.
pub fn ln(self) -> Complex<N>
Computes the principal value of natural logarithm of self
.
This function has one branch cut:
(-∞, 0]
, continuous from above.
The branch satisfies -π ≤ arg(ln(z)) ≤ π
.
pub fn sqrt(self) -> Complex<N>
Computes the principal value of the square root of self
.
This function has one branch cut:
(-∞, 0)
, continuous from above.
The branch satisfies -π/2 ≤ arg(sqrt(z)) ≤ π/2
.
pub fn try_sqrt(self) -> Option<Complex<N>>
pub fn hypot(self, b: Complex<N>) -> <Complex<N> as ComplexField>::RealField
pub fn powf(self, exp: <Complex<N> as ComplexField>::RealField) -> Complex<N>
Raises self
to a floating point power.
pub fn log(self, base: N) -> Complex<N>
Returns the logarithm of self
with respect to an arbitrary base.
pub fn powc(self, exp: Complex<N>) -> Complex<N>
Raises self
to a complex power.
pub fn sin(self) -> Complex<N>
Computes the sine of self
.
pub fn cos(self) -> Complex<N>
Computes the cosine of self
.
pub fn sin_cos(self) -> (Complex<N>, Complex<N>)
pub fn tan(self) -> Complex<N>
Computes the tangent of self
.
pub fn asin(self) -> Complex<N>
Computes the principal value of the inverse sine of self
.
This function has two branch cuts:
(-∞, -1)
, continuous from above.(1, ∞)
, continuous from below.
The branch satisfies -π/2 ≤ Re(asin(z)) ≤ π/2
.
pub fn acos(self) -> Complex<N>
Computes the principal value of the inverse cosine of self
.
This function has two branch cuts:
(-∞, -1)
, continuous from above.(1, ∞)
, continuous from below.
The branch satisfies 0 ≤ Re(acos(z)) ≤ π
.
pub fn atan(self) -> Complex<N>
Computes the principal value of the inverse tangent of self
.
This function has two branch cuts:
(-∞i, -i]
, continuous from the left.[i, ∞i)
, continuous from the right.
The branch satisfies -π/2 ≤ Re(atan(z)) ≤ π/2
.
pub fn sinh(self) -> Complex<N>
Computes the hyperbolic sine of self
.
pub fn cosh(self) -> Complex<N>
Computes the hyperbolic cosine of self
.
pub fn sinh_cosh(self) -> (Complex<N>, Complex<N>)
pub fn tanh(self) -> Complex<N>
Computes the hyperbolic tangent of self
.
pub fn asinh(self) -> Complex<N>
Computes the principal value of inverse hyperbolic sine of self
.
This function has two branch cuts:
(-∞i, -i)
, continuous from the left.(i, ∞i)
, continuous from the right.
The branch satisfies -π/2 ≤ Im(asinh(z)) ≤ π/2
.
pub fn acosh(self) -> Complex<N>
Computes the principal value of inverse hyperbolic cosine of self
.
This function has one branch cut:
(-∞, 1)
, continuous from above.
The branch satisfies -π ≤ Im(acosh(z)) ≤ π
and 0 ≤ Re(acosh(z)) < ∞
.
pub fn atanh(self) -> Complex<N>
Computes the principal value of inverse hyperbolic tangent of self
.
This function has two branch cuts:
(-∞, -1]
, continuous from above.[1, ∞)
, continuous from below.
The branch satisfies -π/2 ≤ Im(atanh(z)) ≤ π/2
.