Fitting Ellipsoids by Least Squares