greens_function_3d

Function greens_function_3d 

Source
pub fn greens_function_3d(r: f64, k: f64) -> Complex64
Expand description

3D Helmholtz Green’s function G = exp(ikr)/(4πr)

§Arguments

  • r - Distance |x - y|
  • k - Wave number

§Returns

Complex value exp(ikr)/(4πr)

§Example

use math_wave::special::helmholtz::greens_function_3d;

let g = greens_function_3d(1.0, 2.0);
// |G| = 1/(4.0 * std::f64::consts::PI) for any k
assert!((g.norm() - 1.0/(4.0 * std::f64::consts::PI)).abs() < 1e-10);