The potential energy surfaces (PESs) for methyl group rotation accompanied by N-atom inversion in isocyanatomethane (MeNCO), isothiocyanatomethane (MeNCS) and azidomethane (MeN3), have been investigated by Moller-Plesset (MP2), coupled cluster (CCD) and, in part, CCSD(T) ab initio calculations. Analytical forms for these surfaces are represented in terms of the (H-3)CNX (X=N, C) angle (thetadegrees) and the HCNX torsion angle (phidegrees) using the expression , where E-0 (theta) and Delta E (theta) are even polynomials in (180-theta). In contrast to previous works of this nature, here it is shown explicitly that the fitting procedure is sufficiently flexible to provide accurate representations of the PES. It is found that the barrier to linearity and the barrier to internal methyl-group rotation both increase in the order MeNCS<MeNCO<MeN3 . The ratio of harmonic to quartic coefficients in the expansion of E-0 (theta) also increases along this same series, and is largely responsible for the geometry of the CNX group becoming increasingly bent. The energetic and structural results compare favourably with data from previous experimental and theoretical studies.