code: def point_line_distance(p, v0, v1):
      """
      Return minimum distance between line segment (v1 - v0) and point p.
  
      Args:
          p: Coordinates of a point.
          v0, v1: Coordinates of the end points of the line segment.
  
      Returns:
          non-square distance to the boundary of the triangle.
  
      Consider the line extending the segment - this can be parameterized as
      ``v0 + t (v1 - v0)``.
  
      First find the projection of point p onto the line. It falls where
      ``t = [(p - v0) . (v1 - v0)] / |v1 - v0|^2``
      where . is the dot product.
  
      The parameter t is clamped from [0, 1] to handle points outside the
      segment (v1 - v0).
  
      Once the projection of the point on the segment is known, the distance from
      p to the projection gives the minimum distance to the segment.
      """
      if p.shape != v0.shape != v1.shape:
          raise ValueError(
              "All points must have the same number of coordinates"
          )
  
      v1v0 = v1 - v0
      l2 = v1v0.dot(v1v0)  # |v1 - v0|^2
      if l2 <= kEpsilon:
          return (p - v1).dot(p - v1)  # v0 == v1
  
      t = v1v0.dot(p - v0) / l2
      t = torch.clamp(t, min=0.0, max=1.0)
      p_proj = v0 + t * v1v0
      delta_p = p_proj - p
      return delta_p.dot(delta_p)
  
file_path: pytorch3d/pytorch3d/renderer/mesh/rasterize_meshes.py
imports: from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  from pytorch3d import _C
  from ..utils import parse_image_size
  from .clip import clip_faces, ClipFrustum, convert_clipped_rasterization_to_original_faces
label_desc: Use image node_id 8 for calling a global function with example usage: point_line_distance(p, v0, v1) and returns: delta_p, unknown