code: def barycentric_coordinates(self, P0, P1, P2, P):
      u = P1 - P0
      v = P2 - P0
      w = P - P0
      #
      vCrossW = np.cross(v, w)
      vCrossU = np.cross(v, u)
      #
      uCrossW = np.cross(u, w)
      uCrossV = np.cross(u, v)
      #
      denom = np.sqrt((uCrossV**2).sum())
      r = np.sqrt((vCrossW**2).sum()) / denom
      t = np.sqrt((uCrossW**2).sum()) / denom
      #
      return (1 - (r + t), r, t)
  
file_path: dense-pose/detectron/utils/densepose_methods.py
imports: import numpy
  import copy
  import cv2
  from scipy.io import loadmat
  import scipy.spatial.distance
  import os
label_desc: Use image node_id 4 for calling the DensePoseMethods obj's underlying member method code with example usage: obj.barycentric_coordinates(P0, P1, P2, P) and returns: unknown,  r,  t