Function plotpy::generate3d

source ·
pub fn generate3d<F>(
    xmin: f64,
    xmax: f64,
    ymin: f64,
    ymax: f64,
    nx: usize,
    ny: usize,
    calc_z: F
) -> (Vec<Vec<f64>>, Vec<Vec<f64>>, Vec<Vec<f64>>)
where F: Fn(f64, f64) -> f64,
Expand description

Generates 3d points (function over meshgrid)

§Input

  • xmin, xmax – range along x
  • ymin, ymax – range along y
  • nx – is the number of points along x (must be >= 2)
  • ny – is the number of points along y (must be >= 2)
  • calc_z – is a function of (xij, yij) that calculates zij

§Output

  • x, y, z – (ny by nx) 2D arrays