.BG
.FN interp
.TL
Bivariate Interpolation for Irregular Data
.CS
interp(x, y, z, xo, yo, ncp=0, extrap=FALSE)
.PP
.AG x
x-coordinates of data points.
.AG y
y-coordinates of data points.
.AG z
z-coordinates of data points.
.AG xo
vector of x-coordinates of output grid.  Default, 40 points
evenly spaced over the range of `x'.
.AG yo
vector of y-coordinates of output grid.  Default, 40 points
evenly spaced over the range of `y'.
.AG ncp
number of additional points to be used in computing partial
derivatives at each data point.  If `ncp' is zero, linear
interpolation will be used in the triangles bounded by data
points.  Otherwise, `ncp' must be 2 or greater, but smaller
than the number of data points.
Cubic interpolation is done if
partial derivatives are used.
.AG extrap
logical flag, should extrapolation be used outside of the
convex hull determined by the data points?
No extrapolation can be performed if `ncp' is zero.
.RT
list with 3 components:
.RC x
vector of x-coordinates of output grid, the same as input
argument `xo'.
.RC y
vector of y-coordinates of output grid, the same as input
argument `yo'.
.RC z
matrix of fitted z-values.  The value `z[i,j]' is computed
at the x,y point `x[i],y[j]'.
.PP
If `extrap' is `FALSE', z-values for points outside the convex hull are
returned as `NA'.  The resulting structure is suitable for input to the
function `contour'.
.SP
.SH REFERENCE
Hiroshi Akima, "A Method of Bivariate Interpolation and
Smooth Surface Fitting for Irregularly Distributed Data
Points",
.ul
ACM Transactions on Mathematical Software,
Vol 4, No 2, June 1978, pp 148-164.
.EX
fit <- interp(x,y,z)      #fit to irregularly spaced data
contour(fit)    #contour plot
.KW dplot
.WR
