I'm not exactly sure what you mean by the quadrant numbers, it's not a definition I'm familiar with.
I've only used CHARMM to compute the improper dihedral, but it's just straightforward geometry for two planes defined by 3 atoms, with 2 common atoms (N,C) defining the axis.