Search for the enclosing Delaunay convex hull
For t <- delaunay(cbind(x, y))
, where (x, y)
is a 2D set of
points, tsearch(x, y, t, xi, yi)
finds the index in t
containing the points (xi, yi)
. For points outside the convex hull
the index is NA
.
tsearch(x, y, t, xi, yi, bary = FALSE, method = "quadtree")
x |
X-coordinates of triangulation points |
y |
Y-coordinates of triangulation points |
t |
Triangulation, e.g. produced by |
xi |
X-coordinates of points to test |
yi |
Y-coordinates of points to test |
bary |
If |
method |
One of |
If bary
is FALSE
, the index in t
containing the points
(xi, yi)
. For points outside the convex hull the index is NA
.
If bary
is TRUE
, a list containing:
the index in t
containing the points (xi, yi)
a 3-column matrix containing the barycentric coordinates with
respect to the enclosing triangle of each point (xi, yi)
.
The original Octave function is Copyright (C) 2007-2012 David Bateman
Jean-Romain Roussel (Quadtree algorithm), David Sterratt (Octave-based implementation)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.