docs: def prism_barycentric_coordinates(tri1, tri2, pt):
      '''
      prism_barycentric_coordinates(tri1, tri2, point) yields a list of weights for each vertex
        in the given tetrahedron in the same order as the vertices given. If all weights are 0, then
        the point is not inside the tetrahedron. The returned weights are (a,b,d) in a numpy array;
        the values a, b, and c are the barycentric coordinates corresponding to the three points of
        the triangles (where c = (1 - a - b) and the value d is the fractional distance (in the range
        [0,1]) of the point between tri1 (d=0) and tri2 (d=1).
      '''
      pt = np.asarray(pt)
      tri1 = np.asarray(tri1)
      tri2 = np.asarray(tri2)
      (tri1,tri2) = [
          (np.transpose(tri, (1,0) if len(tri.shape) == 2 else (2,0,1)) if tri.shape[0] != 3 else
           np.transpose(tri, (0,2,1))                                   if tri.shape[1] != 3 else
           tri)
          for tri in (tri1,tri2)]
      pt = pt.T if pt.shape[0] != 3 else pt
      # get the individual tetrahedron bc coordinates
      bcs1 = tetrahedral_barycentric_coordinates([tri1[0], tri1[1], tri1[2], tri2[0]], pt)
      bcs2 = tetrahedral_barycentric_coordinates([tri1[1], tri1[2], tri2[0], tri2[1]], pt)
      bcs3 = tetrahedral_barycentric_coordinates([tri1[2], tri2[0], tri2[1], tri2[2]], pt)
      bcs4 = tetrahedral_barycentric_coordinates([tri1[0], tri1[1], tri2[0], tri2[1]], pt)
      bcs5 = tetrahedral_barycentric_coordinates([tri1[0], tri1[2], tri2[0], tri2[2]], pt)
      bcs6 = tetrahedral_barycentric_coordinates([tri1[1], tri1[2], tri2[1], tri2[2]], pt)
      bcs = ((bcs1[0] + bcs4[0] + bcs5[0],
              bcs1[1] + bcs2[0] + bcs4[1] + bcs6[0],
              bcs1[2] + bcs2[1] + bcs3[0] + bcs5[1] + bcs6[1]),
             (bcs1[3] + bcs2[2] + bcs3[1] + bcs4[2] + bcs5[2],
              bcs2[3] + bcs3[2] + bcs4[3] + bcs6[2],
              bcs3[3] + bcs5[3] + bcs6[3]))
      # convert into (a,b,c,d) coordinates
      abc = np.sum(bcs, axis=0)
      d = np.sum(bcs[1], axis=0)
      return np.asarray((abc[0], abc[1], d))