the mapping function that takes an x
value from x_values
and a y
value from y_values
, and returns the mapped z_value.
the values to be used as the major axis (rows) of the resulting 2D array.
the values to be used as the minor axis (columns) of the resulting 2D array.
a 2D array with mapped values from x_values
and y_values
map two arrays to a "field" of 2D array through a mapping function.
given a mapping function
map_fn
, and two arraysx_values
andy_values
, this function generates a 2D array where each element is the result of applyingmap_fn
to the corresponding elements fromx_values
andy_values
.Example
z
is a function ofx
andy
defined by:z(x, y) = x + y
.to create a 2d grid of
z_values
usingx_values = [1, 2, 3]
andy_values = [4, 5]
, we do the following: