parameters: (line_orig, line_dest)
return_statement: return line_dir
docstring: Calculates the direction of the public transport line based on the start
      and end nodes of the osm route.
docstring_summary: Calculates the direction of the public transport line based on the start
      and end nodes of the osm route.
docstring_tokens: Calculates the direction of the public transport line based on the start and end nodes of the osm route .
function: def get_line_dir(line_orig, line_dest):
      """
      Calculates the direction of the public transport line based on the start
      and end nodes of the osm route.
      """
      lat_dif = float(line_dest[1]) - float(line_orig[1])
      lon_dif = float(line_dest[0]) - float(line_orig[0])
  
      if lon_dif == 0:  # avoid dividing by 0
          line_dir = 90
      else:
          line_dir = math.degrees(math.atan(abs(lat_dif/lon_dif)))
  
      if lat_dif >= 0 and lon_dif >= 0:  # 1 quadrant
          line_dir = 90 - line_dir
      elif lat_dif < 0 and lon_dif > 0:  # 2 quadrant
          line_dir = 90 + line_dir
      elif lat_dif <= 0 and lon_dif <= 0:  # 3 quadrant
          line_dir = 90 - line_dir + 180
      else:  # 4 quadrant
          line_dir = 270 + line_dir
  
      return line_dir
function_tokens: def get_line_dir ( line_orig , line_dest ) : lat_dif = float ( line_dest [ 1 ] ) - float ( line_orig [ 1 ] ) lon_dif = float ( line_dest [ 0 ] ) - float ( line_orig [ 0 ] ) if lon_dif == 0 : # avoid dividing by 0 line_dir = 90 else : line_dir = math . degrees ( math . atan ( abs ( lat_dif / lon_dif ) ) ) if lat_dif >= 0 and lon_dif >= 0 : # 1 quadrant line_dir = 90 - line_dir elif lat_dif < 0 and lon_dif > 0 : # 2 quadrant line_dir = 90 + line_dir elif lat_dif <= 0 and lon_dif <= 0 : # 3 quadrant line_dir = 90 - line_dir + 180 else : # 4 quadrant line_dir = 270 + line_dir return line_dir