#[repr(C)]pub struct ComplexPolar<FT> {
pub abs: FT,
pub arg: FT,
}Expand description
A complex number in polar form.
Fields§
§abs: FT§arg: FTImplementations§
Source§impl ComplexPolar<f32>
impl ComplexPolar<f32>
Source§impl ComplexPolar<f64>
impl ComplexPolar<f64>
Source§impl<FT> ComplexPolar<FT>
impl<FT> ComplexPolar<FT>
Source§impl<FT: Number> ComplexPolar<FT>
impl<FT: Number> ComplexPolar<FT>
pub const ZERO: Self
pub const ONE: Self
Sourcepub fn to_rectangular(self) -> Rectangular<FT>
pub fn to_rectangular(self) -> Rectangular<FT>
Convert to rectangular form.
Sourcepub fn expm1(self) -> Rectangular<FT>
pub fn expm1(self) -> Rectangular<FT>
Computes e^self - 1.
More numerically stable than self.exp().to_rectangular() - 1 when self ≈ 0.
Sourcepub fn ln(self) -> Rectangular<FT>
pub fn ln(self) -> Rectangular<FT>
Computes the principal natural logarithm.
Sourcepub fn ln_1p(self) -> Rectangular<FT>
pub fn ln_1p(self) -> Rectangular<FT>
Computes the principal natural logarithm of 1 + self.
More numerically stable than (self + 1).ln() when self ≈ 0.
Sourcepub fn log2(self) -> Rectangular<FT>
pub fn log2(self) -> Rectangular<FT>
Computes the principal logarithm in base 2.
Sourcepub fn log10(self) -> Rectangular<FT>
pub fn log10(self) -> Rectangular<FT>
Computes the principal logarithm in base 10.
Sourcepub fn ln_branch(self, k: i32) -> Rectangular<FT>
pub fn ln_branch(self, k: i32) -> Rectangular<FT>
Computes the k-th branch of the natural logarithm.
The principal value is k = 0. Each increment of k adds 2πi.
Sourcepub fn ln_1p_branch(self, k: i32) -> Rectangular<FT>
pub fn ln_1p_branch(self, k: i32) -> Rectangular<FT>
Computes the k-th branch of the natural logarithm of 1 + self.
The principal value is k = 0. Each increment of k adds 2πi.
Sourcepub fn log2_branch(self, k: i32) -> Rectangular<FT>
pub fn log2_branch(self, k: i32) -> Rectangular<FT>
Computes the k-th branch of the base-2 logarithm.
Sourcepub fn log10_branch(self, k: i32) -> Rectangular<FT>
pub fn log10_branch(self, k: i32) -> Rectangular<FT>
Computes the k-th branch of the base-10 logarithm.
Sourcepub fn sqrt_branch(self, k: i32) -> Self
pub fn sqrt_branch(self, k: i32) -> Self
Computes the k-th square root.
The principal value is k = 0. Only k = 0 and k = 1 give distinct values.
Sourcepub fn nth_root(self, n: i32, k: i32) -> Self
pub fn nth_root(self, n: i32, k: i32) -> Self
Computes the k-th value of the n-th root.
The n distinct values correspond to k = 0..n-1.
Sourcepub fn pow_rational(self, p: i32, q: i32, k: i32) -> Self
pub fn pow_rational(self, p: i32, q: i32, k: i32) -> Self
Raises self to the rational power p/q, selecting the k-th branch.
There are q distinct values corresponding to k = 0..q-1, provided p/q is in lowest
terms. If p/q is not reduced, first reduce it to find the true number of distinct values.
Trait Implementations§
Source§impl<FT: AbsDiffEq + Copy> AbsDiffEq for ComplexPolar<FT>
Available on crate feature approx only.
impl<FT: AbsDiffEq + Copy> AbsDiffEq for ComplexPolar<FT>
approx only.Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.Source§impl<FT: Clone> Clone for ComplexPolar<FT>
impl<FT: Clone> Clone for ComplexPolar<FT>
Source§fn clone(&self) -> ComplexPolar<FT>
fn clone(&self) -> ComplexPolar<FT>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<FT: Copy> Copy for ComplexPolar<FT>
Source§impl<FT: Debug> Debug for ComplexPolar<FT>
impl<FT: Debug> Debug for ComplexPolar<FT>
Source§impl<FT: Default> Default for ComplexPolar<FT>
impl<FT: Default> Default for ComplexPolar<FT>
Source§fn default() -> ComplexPolar<FT>
fn default() -> ComplexPolar<FT>
Source§impl Distribution<ComplexPolar<f32>> for StandardUniform
Available on crate feature rand only.
impl Distribution<ComplexPolar<f32>> for StandardUniform
rand only.Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ComplexPolar<f32>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ComplexPolar<f32>
T, using rng as the source of randomness.Source§impl Distribution<ComplexPolar<f64>> for StandardUniform
Available on crate feature rand only.
impl Distribution<ComplexPolar<f64>> for StandardUniform
rand only.Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ComplexPolar<f64>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ComplexPolar<f64>
T, using rng as the source of randomness.Source§impl<FT: Number> Div for ComplexPolar<FT>
impl<FT: Number> Div for ComplexPolar<FT>
Source§impl<FT: Number> Div<FT> for ComplexPolar<FT>
impl<FT: Number> Div<FT> for ComplexPolar<FT>
Source§impl<FT: Number> DivAssign for ComplexPolar<FT>
impl<FT: Number> DivAssign for ComplexPolar<FT>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/= operation. Read moreSource§impl<FT: Number> DivAssign<FT> for ComplexPolar<FT>
impl<FT: Number> DivAssign<FT> for ComplexPolar<FT>
Source§fn div_assign(&mut self, re: FT)
fn div_assign(&mut self, re: FT)
/= operation. Read moreSource§impl<FT: Number> From<FT> for ComplexPolar<FT>
impl<FT: Number> From<FT> for ComplexPolar<FT>
Source§impl<FT: Number> Mul for ComplexPolar<FT>
impl<FT: Number> Mul for ComplexPolar<FT>
Source§impl<FT: Number> Mul<FT> for ComplexPolar<FT>
impl<FT: Number> Mul<FT> for ComplexPolar<FT>
Source§impl<FT: Number> MulAssign for ComplexPolar<FT>
impl<FT: Number> MulAssign for ComplexPolar<FT>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*= operation. Read moreSource§impl<FT: Number> MulAssign<FT> for ComplexPolar<FT>
impl<FT: Number> MulAssign<FT> for ComplexPolar<FT>
Source§fn mul_assign(&mut self, re: FT)
fn mul_assign(&mut self, re: FT)
*= operation. Read moreSource§impl<FT: Number> Neg for ComplexPolar<FT>
impl<FT: Number> Neg for ComplexPolar<FT>
Source§impl<FT: PartialEq> PartialEq for ComplexPolar<FT>
impl<FT: PartialEq> PartialEq for ComplexPolar<FT>
Source§impl<FT: RelativeEq + Copy> RelativeEq for ComplexPolar<FT>
Available on crate feature approx only.
impl<FT: RelativeEq + Copy> RelativeEq for ComplexPolar<FT>
approx only.Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq.impl<FT: PartialEq> StructuralPartialEq for ComplexPolar<FT>
Source§impl<FT: UlpsEq + Copy> UlpsEq for ComplexPolar<FT>
Available on crate feature approx only.
impl<FT: UlpsEq + Copy> UlpsEq for ComplexPolar<FT>
approx only.