docstr: Tests the function that projects a point to a ray.
docstr_tok: ["Tests","the","function","that","projects","a","point","to","a","ray","."]
code: def test_project_to_ray_random(self):
      """Tests the function that projects a point to a ray."""
      eps = sys.float_info.epsilon
      tensor_size = np.random.randint(3)
      tensor_shape = np.random.randint(
          1, 10, size=(tensor_size)
      ).tolist()
      random_origin = np.random.random(size=tensor_shape + [3])
      random_direction = np.random.random(size=tensor_shape + [3])
      random_direction /= np.maximum(
          np.linalg.norm(random_direction, axis=-1, keepdims=True), eps
      )
      random_distances = (
          np.random.random(size=tensor_shape + [1]) * 1000
      )
      x, y, _, _ = np.split(random_direction, (1, 2, 3), axis=-1)
  
      # Find perpendicular vector.
      perp = np.concatenate((-y, x, np.zeros_like(x)), axis=-1)
      perp /= np.maximum(
          np.linalg.norm(perp, axis=-1, keepdims=True), eps
      )
      # Choose a point on perpendicular unit vector at the good distance.
      points = random_origin + perp * random_distances
      points = point.project_to_ray(
          points, random_origin, random_direction
      )
  
      self.assertAllClose(random_origin, points)
  
file_path: graphics/tensorflow_graphics/geometry/representation/tests/point_test.py
imports: import sys
  from absl.testing import flagsaver
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.geometry.representation import point
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 10 for calling the PointTest obj's underlying member method code with example usage: obj.test_project_to_ray_random() without return types