interp_image: Interpolate an even grid of z(x,y) onto arbitrary (x,y)...

Description Usage Arguments Details Value Notes See Also

View source: R/plot_contour.R

Description

interp_image

Usage

1

Arguments

x

(vector) x positions at which to compute z

y

(vector) y positions at which to compute z

img

(list) containing three components: x, y, z

Details

From an image z(x,y) at evenly spaced grid points x = i*dx y = j*dy, return the values of z at arbirary points (x, y) between grid points. The values are calculated using bilinear interpolation. I.e. for an output point (x, y) the corners of the surrounding grid square are identified, and the result is a weighted combination of these four z values: z(x1, y1), z(x2, y1), z(x1, y2), z(x2, y2) where the weights depend on the distances from the x and y boundaries of the grid square.

Value

The output is a vector of z values at the position of each input (x, y) coordinate.

Notes

The input img should be a list with three components: img$z is a vector of nx evenly spaced x positions, img$y is a vector of ny evenly spaced y position, img$z is an nx*ny array of z values at the (x,y) coordinates.

See Also

chain_convergence, contour_matrix


svdataman/tonic documentation built on Aug. 2, 2019, 3:21 p.m.