delaunay_adjacency¶
- delaunay_adjacency(points, dthresh)[source]¶
Create an adjacency matrix via Delaunay triangulation from a list of coordinates.
Points which are further apart than dthresh will not be connected.
See https://en.wikipedia.org/wiki/Adjacency_matrix.
- Parameters:
points (np.ndarray) – An nxm list of coordinates.
dthresh (float) – Distance threshold for triangulation.
- Returns:
Adjacency matrix of shape NxN where 1 indicates connected and 0 indicates unconnected.
- Return type:
ArrayLike
Example
>>> rng = np.random.default_rng() >>> points = rng.random((100, 2)) >>> adjacency = delaunay_adjacency(points)