To remove in the future –– scipy.spatial
.. currentmodule:: scipy.spatial
These are contained in the scipy.spatial.transform
submodule.
.. autosummary::
:toctree:generated/
KDTree -- class for efficient nearest-neighbor queries
cKDTree -- class for efficient nearest-neighbor queries (faster implementation)
Rectangle
Distance metrics are contained in the scipy.spatial.distance
submodule.
.. autosummary::
:toctree:generated/
Delaunay -- compute Delaunay triangulation of input points
ConvexHull -- compute a convex hull for input points
Voronoi -- compute a Voronoi diagram hull from input points
SphericalVoronoi -- compute a Voronoi diagram from input points on the surface of a sphere
HalfspaceIntersection -- compute the intersection points of input halfspaces
.. autosummary::
:toctree:generated/
delaunay_plot_2d -- plot 2-D triangulation
convex_hull_plot_2d -- plot 2-D convex hull
voronoi_plot_2d -- plot 2-D Voronoi diagram
.. seealso:: :ref:`Tutorial <qhulltutorial>`
The simplices (triangles, tetrahedra, etc.) appearing in the Delaunay tessellation (N-D simplices), convex hull facets, and Voronoi ridges (N-1-D simplices) are represented in the following scheme:
tess = Delaunay(points) hull = ConvexHull(points) voro = Voronoi(points) # coordinates of the jth vertex of the ith simplex tess.points[tess.simplices[i, j], :] # tessellation element hull.points[hull.simplices[i, j], :] # convex hull facet voro.vertices[voro.ridge_vertices[i, j], :] # ridge between Voronoi cells
For Delaunay triangulations and convex hulls, the neighborhood structure of the simplices satisfies the condition: tess.neighbors[i,j]
is the neighboring simplex of the ith simplex, opposite to the j
-vertex. It is -1 in case of no neighbor.
Convex hull facets also define a hyperplane equation:
(hull.equations[i,:-1] * coord).sum() + hull.equations[i,-1] == 0
Similar hyperplane equations for the Delaunay triangulation correspond to the convex hull facets on the corresponding N+1-D paraboloid.
The Delaunay triangulation objects offer a method for locating the simplex containing a given point, and barycentric coordinate computations.
.. autosummary::
:toctree:generated/
tsearch
distance_matrix
minkowski_distance
minkowski_distance_p
procrustes
geometric_slerp
.. autosummary::
:toctree:generated/
QhullError
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.spatial.distance.canberrascipy.spatial._kdtree.KDTree.count_neighborsscipy.spatial.distance.dicescipy.spatial.distance.braycurtisscipy.spatial.distance.euclideanscipy.spatial.transform._rotation.Rotationscipy.spatial._qhull.HalfspaceIntersectionscipy.spatial._kdtree.minkowski_distancescipy.spatial.distance.yulescipy.spatial.distance.sokalmichenerscipy.spatial._qhull.ConvexHullscipy.spatial.distance.hammingscipy.spatial.distance.jensenshannonscipy.spatial._kdtree.minkowski_distance_pscipy.spatial.distance.sqeuclideanscipy.spatial._kdtree.KDTree.query_ball_treescipy.spatial._qhull.tsearchscipy.spatial.distance.minkowskiscipy.spatial.distance.kulczynski1scipy.spatial._qhull.Voronoiscipy.spatial._geometric_slerp.geometric_slerpscipy.spatial.distance.kulsinskiscipy.spatial.distance.jaccardscipy.spatial.distance.chebyshevscipy.spatial.distance.cdistscipy.spatial._kdtree.KDTree.query_ball_pointscipy.spatial.transform._rotation_spline.RotationSplinescipy.spatial.distance.mahalanobisscipy.spatial.distance.rogerstanimotoscipy.spatial._plotutils.voronoi_plot_2dscipy.spatial._kdtree.KDTree.queryscipy.spatial._kdtree.KDTree.query_pairsscipy.spatial.distance.russellraoscipy.spatial.distance.cosinescipy.spatial._qhull.Delaunayscipy.spatial._plotutils.convex_hull_plot_2dscipy.spatial.transform._rotation.Slerpscipy.spatial.distance.directed_hausdorffscipy.spatial._plotutils.delaunay_plot_2dscipy.spatial._kdtree.distance_matrixscipy.spatial._kdtree.KDTree.sparse_distance_matrixscipy.spatial.distance.seuclideanscipy.spatial.distance.sokalsneathscipy.spatial._procrustes.procrustesscipy.spatial.distance.cityblockHover 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