Modeling Spacecraft Orientation Using Quaternions