code: def compute_magnitude_angle(
      target_location, current_location, orientation
  ):
      """
      Compute relative angle and distance between a target_location and a current_location
  
          :param target_location: location of the target object
          :param current_location: location of the reference object
          :param orientation: orientation of the reference object
          :return: a tuple composed by the distance to the object and the angle between both objects
      """
      target_vector = np.array(
          [
              target_location.x - current_location.x,
              target_location.y - current_location.y,
          ]
      )
      norm_target = np.linalg.norm(target_vector)
  
      forward_vector = np.array(
          [
              math.cos(math.radians(orientation)),
              math.sin(math.radians(orientation)),
          ]
      )
      d_angle = math.degrees(
          math.acos(
              np.clip(
                  np.dot(forward_vector, target_vector) / norm_target,
                  -1.0,
                  1.0,
              )
          )
      )
  
      return (norm_target, d_angle)
  
file_path: carla/PythonAPI/carla/agents/tools/misc.py
imports: import math
  import numpy
  import carla
label_desc: Use image node_id 5 for calling a global function with example usage: compute_magnitude_angle(target_location, current_location, orientation) and returns: norm_target,  d_angle