code: def right_handed(
      vertical_field_of_view: type_alias.TensorLike,
      aspect_ratio: type_alias.TensorLike,
      near: type_alias.TensorLike,
      far: type_alias.TensorLike,
      name: str = "perspective_right_handed",
  ) -> tf.Tensor:
      """Generates the matrix for a right handed perspective projection.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        vertical_field_of_view: A tensor of shape `[A1, ..., An, 1]`, where the last
          dimension represents the vertical field of view of the frustum expressed
          in radians. Note that values for `vertical_field_of_view` must be in the
          range (0,pi).
        aspect_ratio: A tensor of shape `[A1, ..., An, 1]`, where the last dimension
          stores the width over height ratio of the frustum. Note that values for
          `aspect_ratio` must be non-negative.
        near:  A tensor of shape `[A1, ..., An, 1]`, where the last dimension
          captures the distance between the viewer and the near clipping plane. Note
          that values for `near` must be non-negative.
        far:  A tensor of shape `[A1, ..., An, 1]`, where the last dimension
          captures the distance between the viewer and the far clipping plane. Note
          that values for `far` must be greater than those of `near`.
        name: A name for this op. Defaults to "perspective_right_handed".
  
      Raises:
        InvalidArgumentError: if any input contains data not in the specified range
          of valid values.
        ValueError: if the all the inputs are not of the same shape.
  
      Returns:
        A tensor of shape `[A1, ..., An, 4, 4]`, containing matrices of right
        handed perspective-view frustum.
      """
      with tf.name_scope(name):
          vertical_field_of_view = tf.convert_to_tensor(
              value=vertical_field_of_view
          )
          aspect_ratio = tf.convert_to_tensor(value=aspect_ratio)
          near = tf.convert_to_tensor(value=near)
          far = tf.convert_to_tensor(value=far)
  
          shape.check_static(
              tensor=vertical_field_of_view,
              tensor_name="vertical_field_of_view",
              has_dim_equals=(-1, 1),
          )
          shape.check_static(
              tensor=aspect_ratio,
              tensor_name="aspect_ratio",
              has_dim_equals=(-1, 1),
          )
          shape.check_static(
              tensor=near, tensor_name="near", has_dim_equals=(-1, 1)
          )
          shape.check_static(
              tensor=far, tensor_name="far", has_dim_equals=(-1, 1)
          )
          shape.compare_batch_dimensions(
              tensors=(vertical_field_of_view, aspect_ratio, near, far),
              last_axes=-2,
              tensor_names=(
                  "vertical_field_of_view",
                  "aspect_ratio",
                  "near",
                  "far",
              ),
              broadcast_compatible=False,
          )
  
          vertical_field_of_view = asserts.assert_all_in_range(
              vertical_field_of_view, 0.0, math.pi, open_bounds=True
          )
          aspect_ratio = asserts.assert_all_above(
              aspect_ratio, 0.0, open_bound=True
          )
          near = asserts.assert_all_above(near, 0.0, open_bound=True)
          far = asserts.assert_all_above(far, near, open_bound=True)
  
          inverse_tan_half_vertical_field_of_view = 1.0 / tf.tan(
              vertical_field_of_view * 0.5
          )
          zero = tf.zeros_like(inverse_tan_half_vertical_field_of_view)
          one = tf.ones_like(inverse_tan_half_vertical_field_of_view)
          near_minus_far = near - far
          matrix = tf.concat(
              (
                  inverse_tan_half_vertical_field_of_view
                  / aspect_ratio,
                  zero,
                  zero,
                  zero,
                  zero,
                  inverse_tan_half_vertical_field_of_view,
                  zero,
                  zero,
                  zero,
                  zero,
                  (far + near) / near_minus_far,
                  2.0 * far * near / near_minus_far,
                  zero,
                  zero,
                  -one,
                  zero,
              ),
              axis=-1,
          )
          matrix_shape = tf.shape(input=matrix)
          output_shape = tf.concat((matrix_shape[:-1], (4, 4)), axis=-1)
          return tf.reshape(matrix, shape=output_shape)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from typing import Tuple
  import tensorflow
  from tensorflow_graphics.geometry.representation import grid
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import safe_ops
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 2 for calling a global function with example usage: right_handed(vertical_field_of_view, aspect_ratio, near, far, name) and returns: tf