Skip to main content

cauchy_integral

Function cauchy_integral 

Source
pub fn cauchy_integral(
    f: impl Fn(Complex) -> Complex,
    contour: &[Complex],
) -> Complex
Expand description

Compute the Cauchy contour integral ∮ f(z) dz along a polygonal contour.

The contour is given as a sequence of vertices; the integral is computed using the trapezoidal rule over the straight segments connecting them. The contour is automatically closed (last vertex connected back to first).

§Arguments

  • f - analytic function to integrate
  • contour - ordered list of waypoints on the contour (polygonal path)

§Returns

Approximation of the contour integral.