code: def triangle_center(tri, uv=False):
      
      if uv:
          data = [t.uv for t in tri]
          mid = [0.0, 0.0]
      else:
          data = tri.vertices
          mid = [0.0, 0.0, 0.0]
      for vert in data:
          mid = [m + v for m, v in zip(mid, vert)]
      mid = [float(m) / 3.0 for m in mid]
      return tuple(mid)
docs: Computes the center of mass of the input triangle.
  
      :param tri: triangle object
      :type tri: elements.Triangle
      :param uv: if True, then finds parametric position of the center of mass
      :type uv: bool
      :return: center of mass of the triangle
      :rtype: tuple