For t = delaunayn(x)
, where x
is a set of points in d
dimensions, tsearchn(x, t, xi)
finds the index in t
containing the points xi
. For points outside the convex hull,
idx
is NA
. tsearchn
also returns the barycentric
coordinates p
of the enclosing triangles.
tsearchn(x, t, xi, fast = TRUE)
An n
-by-d
matrix. The rows of x
represent
n
points in d
-dimensional space.
A m
-by-d+1
matrix. A row of t
contains
indices into x
of the vertices of a d
-dimensional simplex.
t
is usually the output of delaunayn.
An ni
-by-d
matrix. The rows of xi
represent
n
points in d
-dimensional space whose positions in the mesh
are being sought.
If the data is in 2D, use the fast C-based tsearch
function to produce the results.
A list containing:
An ni
-long vector
containing the indicies of the row of t
in which each point in
xi
is found.
An ni
-by-d+1
matrix
containing the barycentric coordinates with respect to the enclosing
simplex of each point in xi
.
tsearch, delaunayn