pub struct ComplexAnalysis;Expand description
Complex analysis operations.
Implementations§
Source§impl ComplexAnalysis
impl ComplexAnalysis
Sourcepub fn residue_simple_pole(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
h: f64,
) -> Complex
pub fn residue_simple_pole( f: &dyn Fn(Complex) -> Complex, z0: Complex, h: f64, ) -> Complex
Compute residue of f(z) at z0 using Laurent series approximation. For simple pole: lim_{z->z0} (z - z0) * f(z)
Sourcepub fn residue_pole_order_n(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
order: usize,
h: f64,
) -> Complex
pub fn residue_pole_order_n( f: &dyn Fn(Complex) -> Complex, z0: Complex, order: usize, h: f64, ) -> Complex
Compute residue using derivative formula for higher order poles. For pole of order n: (1/(n-1)!) * lim_{z->z0} d^{n-1}/dz^{n-1} [(z-z0)^n * f(z)]
Sourcepub fn derivative(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> Complex
pub fn derivative(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> Complex
Numerical derivative of complex function (central difference on the real axis).
Sourcepub fn derivative_complex_step(
f: &dyn Fn(Complex) -> Complex,
z: Complex,
h: f64,
) -> Complex
pub fn derivative_complex_step( f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64, ) -> Complex
Complex derivative via the complex-step method.
For analytic f, f'(z) = (f(z + ih) − f(z − ih)) / (2ih) with
error O(h²). Stepping along the imaginary axis exercises the
derivative in the complex plane (not just along the real axis) and
avoids the cancellation that limits real finite differences.
Sourcepub fn derivative_cauchy(
f: &dyn Fn(Complex) -> Complex,
z: Complex,
radius: f64,
n: usize,
) -> Complex
pub fn derivative_cauchy( f: &dyn Fn(Complex) -> Complex, z: Complex, radius: f64, n: usize, ) -> Complex
Full complex derivative via the Cauchy integral formula:
f'(z) = (1/(2πi)) ∮ f(w)/(w − z)² dw around a circle of radius
sampled at n points. Robust for analytic f (no finite-difference
step-size tuning needed).
Sourcepub fn nth_derivative(
f: &dyn Fn(Complex) -> Complex,
z: Complex,
n: usize,
h: f64,
) -> Complex
pub fn nth_derivative( f: &dyn Fn(Complex) -> Complex, z: Complex, n: usize, h: f64, ) -> Complex
Nth derivative of complex function.
Sourcepub fn contour_integral_circle(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
radius: f64,
n: usize,
) -> Complex
pub fn contour_integral_circle( f: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> Complex
Contour integral using trapezoidal rule on a circle. ∮_C f(z) dz where C is circle centered at z0 with radius r.
Sourcepub fn cauchy_integral_formula(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
radius: f64,
n: usize,
) -> Complex
pub fn cauchy_integral_formula( f: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> Complex
Cauchy integral formula: f(z0) = (1/(2πi)) ∮_C f(z)/(z-z0) dz
Sourcepub fn cauchy_derivative_formula(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
n: usize,
radius: f64,
contour_n: usize,
) -> Complex
pub fn cauchy_derivative_formula( f: &dyn Fn(Complex) -> Complex, z0: Complex, n: usize, radius: f64, contour_n: usize, ) -> Complex
Cauchy’s derivative formula: f^(n)(z0) = (n!/(2πi)) ∮_C f(z)/(z-z0)^(n+1) dz
Sourcepub fn is_analytic(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> bool
pub fn is_analytic(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> bool
Check if function is analytic at point (using Cauchy-Riemann equations).
Sourcepub fn laurent_series_coefficients(
f: &dyn Fn(Complex) -> Complex,
z0: Complex,
max_positive: usize,
max_negative: usize,
radius: f64,
n_points: usize,
) -> (Vec<Complex>, Vec<Complex>)
pub fn laurent_series_coefficients( f: &dyn Fn(Complex) -> Complex, z0: Complex, max_positive: usize, max_negative: usize, radius: f64, n_points: usize, ) -> (Vec<Complex>, Vec<Complex>)
Compute Laurent series coefficients around z0. Returns (a_n for n >= 0, a_n for n < 0)
Sourcepub fn mobius_transform(
z: Complex,
a: Complex,
b: Complex,
c: Complex,
d: Complex,
) -> Complex
pub fn mobius_transform( z: Complex, a: Complex, b: Complex, c: Complex, d: Complex, ) -> Complex
Conformal mapping: Möbius transformation. f(z) = (az + b) / (cz + d)
Sourcepub fn mobius_inverse(
w: Complex,
a: Complex,
b: Complex,
c: Complex,
d: Complex,
) -> Complex
pub fn mobius_inverse( w: Complex, a: Complex, b: Complex, c: Complex, d: Complex, ) -> Complex
Inverse Möbius transformation.
Sourcepub fn schwarz_christoffel(
z: Complex,
vertices: &[Complex],
angles: &[f64],
pre_factor: Complex,
) -> Complex
pub fn schwarz_christoffel( z: Complex, vertices: &[Complex], angles: &[f64], pre_factor: Complex, ) -> Complex
Schwarz-Christoffel mapping (simplified for polygon). Maps upper half-plane to polygon interior.