Simultaneous determination of spacecraft attitude and rates using only a magnetometer