def trunk_angles(nrn, neurite_type=NeuriteType.all):
vectors = trunk_vectors(nrn, neurite_type=neurite_type)<EOL>if not vectors.size:<EOL><INDENT>return []<EOL><DEDENT>def _sort_angle(p1, p2):<EOL><INDENT>"""<STR_LIT>"""<EOL>ang1 = np.arctan2(*p1[::-<NUM_LIT:1>])<EOL>ang2 = np.arctan2(*p2[::-<NUM_LIT:1>])<EOL>return (ang1 - ang2)<EOL><DEDENT>order = np.argsort(np.array([_sort_angle(i / np.linalg.norm(i), [<NUM_LIT:0>, <NUM_LIT:1>])<EOL>for i in vectors[:, <NUM_LIT:0>:<NUM_LIT:2>]]))<EOL>ordered_vectors = vectors[order][:, [COLS.X, COLS.Y]]<EOL>return [morphmath.angle_between_vectors(ordered_vectors[i], ordered_vectors[i - <NUM_LIT:1>])<EOL>for i, _ in enumerate(ordered_vectors)]<EOL>
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.