quaternion code is now merged with AmMatrix since it is used there