Given the extremes of the range and the number of cells along x and y, it generates a two-dimensional grid. Cells are counted from the minimum of x and y (bottom-left). You can choose whether to increase x or y faster.
Slots
xcell
numeric, number of cells along x
ycell
numeric, number of cells along y
xmin
numeric, lower limit along x
xmax
numeric, upper limit along x
ymin
numeric, lower limit along y
ymax
numeric, upper limit along y
by
character, count cells increasing x ("h") or y ("v") faster
Examples
grid2d <- makeGrid2d(
xmin = -50, xmax = 50, xcell = 100,
ymin = -50, ymax = 50, ycell = 100,
by = "v"
)
grid2d
#> class : Grid2d
#> dimensions : xcell = 100, ycell = 100, ncell = 10000
#> range : xmin = -50, xmax = 50
#> ymin = -50, ymax = 50
#> by : v, count starts from xmin, ymin (bottom-left)
#> and y increase faster
makeGrid2d()
#> class : Grid2d
#> dimensions : xcell = 10, ycell = 10, ncell = 100
#> range : xmin = -5, xmax = 5
#> ymin = -5, ymax = 5
#> by : h, count starts from xmin, ymin (bottom-left)
#> and x increase faster