docstr: Computes the barycentric coordinates of point wrt triangle (tri)
  Note that point needs to live in the space spanned by tri = (a, b, c),
  i.e. by taking the projection of an arbitrary point on the space spanned by tri
  
  Args:
      point: FloatTensor of shape (3)
      tri: FloatTensor of shape (3, 3)
  Returns:
      bary: FloatTensor of shape (3)
docstr_tok: ["Computes","the","barycentric","coordinates","of","point","wrt","triangle","(","tri",")","Note","that","point","needs","to","live","in","the","space","spanned","by","tri","=","(","a",",","b",",","c",")",",","i.e",".","by","taking","the","projection","of","an","arbitrary","point","on","the","space","spanned","by","tri","Args",":","point",":","FloatTensor","of","shape","(","3",")","tri",":","FloatTensor","of","shape","(","3",",","3",")","Returns",":","bary",":","FloatTensor","of","shape","(","3",")"]
code: def _point_to_bary(
      point: torch.Tensor, tri: torch.Tensor
  ) -> torch.Tensor:
      """
      Computes the barycentric coordinates of point wrt triangle (tri)
      Note that point needs to live in the space spanned by tri = (a, b, c),
      i.e. by taking the projection of an arbitrary point on the space spanned by tri
  
      Args:
          point: FloatTensor of shape (3)
          tri: FloatTensor of shape (3, 3)
      Returns:
          bary: FloatTensor of shape (3)
      """
      assert point.dim() == 1 and point.shape[0] == 3
      assert tri.dim() == 2 and tri.shape[0] == 3 and tri.shape[1] == 3
  
      a, b, c = tri.unbind(0)
  
      v0 = b - a
      v1 = c - a
      v2 = point - a
  
      d00 = v0.dot(v0)
      d01 = v0.dot(v1)
      d11 = v1.dot(v1)
      d20 = v2.dot(v0)
      d21 = v2.dot(v1)
  
      denom = d00 * d11 - d01 * d01 + TestPointMeshDistance.eps()
      s2 = (d11 * d20 - d01 * d21) / denom
      s3 = (d00 * d21 - d01 * d20) / denom
      s1 = 1.0 - s2 - s3
  
      bary = torch.tensor([s1, s2, s3])
      return bary
  
imports: import unittest
  import numpy
  import torch
  from pytorch3d import _C
  from pytorch3d.loss import point_mesh_edge_distance, point_mesh_face_distance
  from pytorch3d.structures import Meshes, packed_to_list, Pointclouds
  from .common_testing import get_random_cuda_device, TestCaseMixin
label_desc: Use image node_id 5 for calling the TestPointMeshDistance obj's underlying member method code with example usage: obj._point_to_bary(point, tri) and returns: bary