Learn R Programming

mapycusmaximus (version 1.0.7)

create_test_grid: Create a Regular Test Grid of Coordinates

Description

Generates a 2D grid of equally spaced points, useful for testing fisheye transformations and other spatial warping functions.

Usage

create_test_grid(range = c(-1, 1), spacing = 0.1)

Value

A numeric matrix with two columns (x, y) containing the coordinates of the grid points.

Arguments

range

Numeric vector of length 2 giving the x and y limits of the grid (default = c(-1, 1)).

spacing

Numeric. Distance between adjacent grid points along each axis (default = 0.1).

See Also

plot_fisheye_fgc(), fisheye_fgc()

Examples

Run this code
# Create a grid from -1 to 1 with spacing 0.25
grid <- create_test_grid(range = c(-1, 1), spacing = 0.25)
head(grid)

Run the code above in your browser using DataLab