code: def _directional_atan(numerator, denominator):
      """Compute atan in a directional sense as required for geodesics.
  
      Explanation
      ===========
  
      To be able to control the direction of the geodesic length along the
      surface of a cylinder a dedicated arctangent function is needed that
      properly handles the directionality of different case. This function
      ensures that the central angle is always positive but shifting the case
      where ``atan2`` would return a negative angle to be centered around
      ``2*pi``.
  
      Notes
      =====
  
      This function only handles very specific cases, i.e. the ones that are
      expected to be encountered when calculating symbolic geodesics on uniformly
      curved surfaces. As such, ``NotImplemented`` errors can be raised in many
      cases. This function is named with a leader underscore to indicate that it
      only aims to provide very specific functionality within the private scope
      of this module.
  
      """
  
      if numerator.is_number and denominator.is_number:
          angle = atan2(numerator, denominator)
          if angle < 0:
              angle += 2 * pi
      elif numerator.is_number:
          msg = (
              f"Cannot compute a directional atan when the numerator {numerator} "
              f"is numeric and the denominator {denominator} is symbolic."
          )
          raise NotImplementedError(msg)
      elif denominator.is_number:
          msg = (
              f"Cannot compute a directional atan when the numerator {numerator} "
              f"is symbolic and the denominator {denominator} is numeric."
          )
          raise NotImplementedError(msg)
      else:
          ratio = sympify(trigsimp(numerator / denominator))
          if isinstance(ratio, tan):
              angle = ratio.args[0]
          elif (
              ratio.is_Mul
              and ratio.args[0] == Integer(-1)
              and isinstance(ratio.args[1], tan)
          ):
              angle = 2 * pi - ratio.args[1].args[0]
          else:
              msg = f"Cannot compute a directional atan for the value {ratio}."
              raise NotImplementedError(msg)
  
      return angle
  
imports: from abc import ABC, abstractmethod
  from sympy import Integer, acos, pi, sqrt, sympify, tan
  from sympy.core.relational import Eq
  from sympy.functions.elementary.trigonometric import atan2
  from sympy.polys.polytools import cancel
  from sympy.physics.vector import Vector, dot
  from sympy.simplify.simplify import trigsimp
label_desc: Use image node_id 1 for calling a global function with example usage: _directional_atan(numerator, denominator) and returns: angle