scipy 1.8.0 Pypi GitHub Homepage
Other Docs
BackRef
tsearch(tri, xi)
versionadded

Find simplices containing the given points. This function does the same thing as Delaunay.find_simplex .

See Also

Delaunay.find_simplex

Examples

>>> import numpy as np
... import matplotlib.pyplot as plt
... from scipy.spatial import Delaunay, delaunay_plot_2d, tsearch
... rng = np.random.default_rng()

The Delaunay triangulation of a set of random points:

>>> pts = rng.random((20, 2))
... tri = Delaunay(pts)
... _ = delaunay_plot_2d(tri)

Find the simplices containing a given set of points:

>>> loc = rng.uniform(0.2, 0.8, (5, 2))
... s = tsearch(tri, loc)
... plt.triplot(pts[:, 0], pts[:, 1], tri.simplices[s], 'b-', mask=s==-1)
... plt.scatter(loc[:, 0], loc[:, 1], c='r', marker='x')
... plt.show()
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.spatial._qhull.tsearch

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : None#None
type: <class 'builtin_function_or_method'>
Commit: