tsearchn: Search for the enclosing Delaunay convex hull

Description Usage Arguments Value Note Author(s) See Also

View source: R/tsearch.R


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.


Based on the Octave function Copyright (C) 2007-2012 David Bateman.


David Sterratt

See Also

tsearch, delaunayn

geometry documentation built on May 21, 2017, 3:40 a.m.

Search within the geometry package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.