code: def getProjectionMatrix(znear, zfar, fovX, fovY):
      tanHalfFovY = math.tan((fovY / 2))
      tanHalfFovX = math.tan((fovX / 2))
  
      top = tanHalfFovY * znear
      bottom = -top
      right = tanHalfFovX * znear
      left = -right
  
      P = torch.zeros(4, 4)
  
      z_sign = 1.0
  
      P[0, 0] = 2.0 * znear / (right - left)
      P[1, 1] = 2.0 * znear / (top - bottom)
      P[0, 2] = (right + left) / (right - left)
      P[1, 2] = (top + bottom) / (top - bottom)
      P[3, 2] = z_sign
      P[2, 2] = z_sign * zfar / (zfar - znear)
      P[2, 3] = -(zfar * znear) / (zfar - znear)
      return P
  
file_path: gaussian-splatting/utils/graphics_utils.py
imports: import torch
  import math
  import numpy
  from typing import NamedTuple
label_desc: Use image node_id 4 for calling a global function with example usage: getProjectionMatrix(znear, zfar, fovX, fovY) and returns: P