Some new identities of the Clebsch–Gordan coefficients and representation functions of SO(2,1) and SO(4)