Description Usage Arguments Value
View source: R/function_to_matrix.R
Create the x
, y
, and z
data needed to plot
a function in 3D
1 2 3 4 5 6 7 8 9 10 | aitoa.function.to.matrix(
x.min = -5,
x.max = if (x.min < 0) -x.min else if (x.min == 0) 1 else max((x.min + 1), 1.1 *
x.min),
y.min = x.min,
y.max = x.max,
n.points.x = 101L,
n.points.y = n.points.x,
f = aitoa.rosenbrock
)
|
x.min |
the minimum value of the x-coordinate |
x.max |
the maximum value of the x-corrdinate |
y.min |
the minimum value of the y-coordinate |
y.max |
the maximum value of the y-corrdinate |
n.points.x |
the number of points to generate along the x-axis |
n.points.y |
the number of points to generate along the y-axis |
f |
a function taking a 2-dimensional vector as input and returning the z-coordinate as output |
a list(x, y, z, grid)
, where x
and y
are
numerical vectors of x
and y
coordinates and z
is a
matrix with the z
coordinate for each x-y
pair and
grid
is a matrix with two columns and one row, one row per
x-y
pair
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.