Ellipsoid fitting with the Cayley transform