The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters. An efficient method is presented for rigorous quantum calculations of atom-molecule and molecule-molecule collisions in a magnetic field. The method is based on the expansion of the wave function of the collision complex in basis functions with well-defined total angular momentum in the body-fixed coordinate frame. We outline the general theory of the method for collisions of diatomic molecules in the 2 ⌺ and 3 ⌺ electronic states with structureless atoms and with unlike 2 ⌺ and 3 ⌺ molecules. The cross sections for elastic scattering and Zeeman relaxation in low-temperature collisions of CaH͑ 2 ⌺ + ͒ and NH͑ 3 ⌺ − ͒ molecules with 3 He atoms converge quickly with respect to the number of total angular momentum states included in the basis set, leading to a dramatic ͑Ͼ10-fold͒ enhancement in computational efficiency compared to the previously used methods ͓A. Volpi and J. L. Bohn, Phys. Rev. A 65, 052712 ͑2002͒; R. V. Krems and A. Dalgarno, J. Chem. Phys. 120, 2296 ͑2004͔͒. Our approach is thus well suited for theoretical studies of strongly anisotropic molecular collisions in the presence of external electromagnetic fields.