powered by
Constructs a bilinear uniform interpolator given a grid of data points.
bilinear_uniform(x, rows, cols, dx = 1, dy = 1, x0 = 0, y0 = 0)
An object of class bilinear_uniform with methods:
bilinear_uniform
interpolate(xi, yi): Evaluate the interpolator at point (xi, yi).
interpolate(xi, yi)
(xi, yi)
Numeric vector of all grid elements
Integer representing the number of rows in the grid
Integer representing the number of columns in the grid
Numeric value representing the spacing between grid points in the x-direction, defaults to 1
Numeric value representing the spacing between grid points in the y-direction, defaults to 1
Numeric value representing the x-coordinate of the origin, defaults to 0
Numeric value representing the y-coordinate of the origin, defaults to 0
x <- seq(0, 1, length.out = 10) interpolator <- bilinear_uniform(x, rows = 2, cols = 5) xi <- 0.5 yi <- 0.5 interpolator$interpolate(xi, yi)
Run the code above in your browser using DataLab