title: Delaunay Triangulation simplices - scipy
body: <p>I was reading about <a href="https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.Delaunay.html" rel="nofollow noreferrer">Delaunay (scipy)</a> and came across the code:</p>
  <pre><code>import numpy as np
  points = np.array([[0, 0], [0, 1.1], [1, 0], [1, 1]])
  
  from scipy.spatial import Delaunay
  tri = Delaunay(points)
  
  import matplotlib.pyplot as plt
  plt.triplot(points[:,0], points[:,1], tri.simplices.copy())
  plt.plot(points[:,0], points[:,1], 'o')
  plt.show()
  </code></pre>
  <p>As far as I understand, a simplex is the generalization of a triangle to higher dimensions.</p>
  <p>I don't understand the meaning of the code below and would like help understanding it:</p>
  <pre><code># Point indices and coordinates for the two triangles forming the triangulation:
  
  tri.simplices
  array([[3, 2, 0],
         [3, 1, 0]], dtype=int32)
  
  points[tri.simplices]
  array([[[ 1. ,  1. ],
          [ 1. ,  0. ],
          [ 0. ,  0. ]],
         [[ 1. ,  1. ],
          [ 0. ,  1.1],
          [ 0. ,  0. ]]])
  
  Triangle 0 is the only neighbor of triangle 1, and it’s opposite to vertex 1 of triangle 1:
  
  
  tri.neighbors[1]
  # array([-1,  0, -1], dtype=int32)
  
  points[tri.simplices[1,1]]
  array([ 0. ,  1.1])
  </code></pre>
  <p>Thanks!</p>