class_docstr: Class to handle camera geometry.
class_docstr_tok: ["Class","to","handle","camera","geometry","."]
docstr: Creates a copy of the camera which looks at a given point.
  
  Copies the provided vision_sfm camera and returns a new camera that is
  positioned at `camera_position` while looking at `look_at_position`.
  Camera intrinsics are copied by this method. A common value for the
  up_vector is (0, 1, 0).
  
  Args:
    position: A (3,) numpy array representing the position of the camera.
    look_at: A (3,) numpy array representing the location the camera looks at.
    up: A (3,) numpy array representing the up direction, whose projection is
      parallel to the y-axis of the image plane.
    eps: a small number to prevent divides by zero.
  
  Returns:
    A new camera that is copied from the original but is positioned and
      looks at the provided coordinates.
  
  Raises:
    ValueError: If the camera position and look at position are very close
      to each other or if the up-vector is parallel to the requested optical
      axis.
docstr_tok: ["Creates","a","copy","of","the","camera","which","looks","at","a","given","point",".","Copies","the","provided","vision_sfm","camera","and","returns","a","new","camera","that","is","positioned","at","`","camera_position","`","while","looking","at","`","look_at_position","`",".","Camera","intrinsics","are","copied","by","this","method",".","A","common","value","for","the","up_vector","is","(","0",",","1",",","0",")",".","Args",":","position",":","A","(","3",",",")","numpy","array","representing","the","position","of","the","camera",".","look_at",":","A","(","3",",",")","numpy","array","representing","the","location","the","camera","looks","at",".","up",":","A","(","3",",",")","numpy","array","representing","the","up","direction",",","whose","projection","is","parallel","to","the","y-axis","of","the","image","plane",".","eps",":","a","small","number","to","prevent","divides","by","zero",".","Returns",":","A","new","camera","that","is","copied","from","the","original","but","is","positioned","and","looks","at","the","provided","coordinates",".","Raises",":","ValueError",":","If","the","camera","position","and","look","at","position","are","very","close","to","each","other","or","if","the","up-vector","is","parallel","to","the","requested","optical","axis","."]
code: def look_at(self, position, look_at, up, eps=1e-6):
      """Creates a copy of the camera which looks at a given point.
  
      Copies the provided vision_sfm camera and returns a new camera that is
      positioned at `camera_position` while looking at `look_at_position`.
      Camera intrinsics are copied by this method. A common value for the
      up_vector is (0, 1, 0).
  
      Args:
        position: A (3,) numpy array representing the position of the camera.
        look_at: A (3,) numpy array representing the location the camera looks at.
        up: A (3,) numpy array representing the up direction, whose projection is
          parallel to the y-axis of the image plane.
        eps: a small number to prevent divides by zero.
  
      Returns:
        A new camera that is copied from the original but is positioned and
          looks at the provided coordinates.
  
      Raises:
        ValueError: If the camera position and look at position are very close
          to each other or if the up-vector is parallel to the requested optical
          axis.
      """
  
      look_at_camera = self.copy()
      optical_axis = look_at - position
      norm = np.linalg.norm(optical_axis)
      if norm < eps:
          raise ValueError(
              "The camera center and look at position are too close."
          )
      optical_axis /= norm
  
      right_vector = np.cross(optical_axis, up)
      norm = np.linalg.norm(right_vector)
      if norm < eps:
          raise ValueError(
              "The up-vector is parallel to the optical axis."
          )
      right_vector /= norm
  
      # The three directions here are orthogonal to each other and form a right
      # handed coordinate system.
      camera_rotation = np.identity(3)
      camera_rotation[0, :] = right_vector
      camera_rotation[1, :] = np.cross(optical_axis, right_vector)
      camera_rotation[2, :] = optical_axis
  
      look_at_camera.position = position
      look_at_camera.orientation = camera_rotation
      return look_at_camera
  
imports: import copy
  import json
  from typing import Tuple, Union, Optional
  import numpy
  from nerfies import gpath
  from nerfies import types
label_desc: Use image node_id 23 for calling the Camera obj's underlying member method code with example usage: obj.look_at(position, look_at, up, eps) and returns: look_at_camera