parameters: (eye, fp, cr)
return_statement: return at
docstring: project center of rotation onto focal point to keep gaze direction the same
      while allowing both translate and zoom in and out to work
docstring_summary: project center of rotation onto focal point to keep gaze direction the same
      while allowing both translate and zoom in and out to work
docstring_tokens: project center of rotation onto focal point to keep gaze direction the same while allowing both translate and zoom in and out to work
function: def project_to_at(eye, fp, cr):
      """project center of rotation onto focal point to keep gaze direction the same
      while allowing both translate and zoom in and out to work"""
      d_fp = [fp[0]-eye[0], fp[1]-eye[1], fp[2]-eye[2]]
      d_cr = [cr[0]-eye[0], cr[1]-eye[1], cr[2]-eye[2]]
      num = (d_fp[0]*d_cr[0] + d_fp[1]*d_cr[1] + d_fp[2]*d_cr[2])
      den = (d_fp[0]*d_fp[0] + d_fp[1]*d_fp[1] + d_fp[2]*d_fp[2])
      if den == 0:
          return cr
      rat = num/den
      p_fp = [rat*d_fp[0], rat*d_fp[1], rat*d_fp[2]]
      at = [p_fp[0]+eye[0], p_fp[1]+eye[1], p_fp[2]+eye[2]]
      return at
function_tokens: def project_to_at ( eye , fp , cr ) : d_fp = [ fp [ 0 ] - eye [ 0 ] , fp [ 1 ] - eye [ 1 ] , fp [ 2 ] - eye [ 2 ] ] d_cr = [ cr [ 0 ] - eye [ 0 ] , cr [ 1 ] - eye [ 1 ] , cr [ 2 ] - eye [ 2 ] ] num = ( d_fp [ 0 ] * d_cr [ 0 ] + d_fp [ 1 ] * d_cr [ 1 ] + d_fp [ 2 ] * d_cr [ 2 ] ) den = ( d_fp [ 0 ] * d_fp [ 0 ] + d_fp [ 1 ] * d_fp [ 1 ] + d_fp [ 2 ] * d_fp [ 2 ] ) if den == 0 : return cr rat = num / den p_fp = [ rat * d_fp [ 0 ] , rat * d_fp [ 1 ] , rat * d_fp [ 2 ] ] at = [ p_fp [ 0 ] + eye [ 0 ] , p_fp [ 1 ] + eye [ 1 ] , p_fp [ 2 ] + eye [ 2 ] ] return at