code: def trunk_angles(nrn, neurite_type=NeuriteType.all):
      '''Calculates the angles between all the trunks of the neuron.
      The angles are defined on the x-y plane and the trees
      are sorted from the y axis and anticlock-wise.
      '''
      vectors = trunk_vectors(nrn, neurite_type=neurite_type)
      if not vectors.size:
          return []
      def _sort_angle(p1, p2):
          ang1 = np.arctan2(*p1[::-1])
          ang2 = np.arctan2(*p2[::-1])
          return (ang1 - ang2)
      order = np.argsort(np.array([_sort_angle(i / np.linalg.norm(i), [0, 1])
                                   for i in vectors[:, 0:2]]))
      ordered_vectors = vectors[order][:, [COLS.X, COLS.Y]]
      return [morphmath.angle_between_vectors(ordered_vectors[i], ordered_vectors[i - 1])
              for i, _ in enumerate(ordered_vectors)]