code: def _compute_static_prob(tri, com):
      
      sv = [(v - com) / np.linalg.norm(v - com) for v in tri]
  
      # Use L'Huilier's Formula to compute spherical area
      a = np.arccos(min(1, max(-1, np.dot(sv[0], sv[1]))))
      b = np.arccos(min(1, max(-1, np.dot(sv[1], sv[2]))))
      c = np.arccos(min(1, max(-1, np.dot(sv[2], sv[0]))))
      s = (a + b + c) / 2.0
  
      # Prevents weirdness with arctan
      try:
          return 1.0 / np.pi * np.arctan(np.sqrt(np.tan(s / 2) * np.tan(
              (s - a) / 2) * np.tan((s - b) / 2) * np.tan((s - c) / 2)))
      except BaseException:
          s = s + 1e-8
          return 1.0 / np.pi * np.arctan(np.sqrt(np.tan(s / 2) * np.tan(
              (s - a) / 2) * np.tan((s - b) / 2) * np.tan((s - c) / 2)))
docs: For an object with the given center of mass, compute
      the probability that the given tri would be the first to hit the
      ground if the object were dropped with a pose chosen uniformly at random.
  
      Parameters
      ----------
      tri: (3,3) float, the vertices of a triangle
      cm:  (3,) float, the center of mass of the object
  
      Returns
      -------
      prob: float, the probability in [0,1] for the given triangle