def _area_of_tri(self, tri):
"""Return the area of the given triangle.
Parameters
----------
tri : :obj:`numpy.ndarray` of int
The triangle for which we wish to compute an area.
Returns
-------
float
The area of the triangle.
"""
verts = [self.vertices[i] for i in tri]
ab = verts[1] - verts[0]
ac = verts[2] - verts[0]
return 0.5 * np.linalg.norm(np.cross(ab, ac))
评论列表
文章目录