Equivalent ellipsoid of a set of 3D points.

   ELL = equivalentEllipsoid(PTS)
   Compute the equivalent ellipsoid of the set of points PTS. The result
   is an ellipsoid defined by:
   ELL = [XC YC ZC  A B C  PHI THETA PSI]
   where [XC YC ZY] is the center, [A B C] are the lengths of the
   semi-axes (in decreasing order), and [PHI THETA PSI] are Euler angles
   representing  the ellipsoid orientation, in degrees.

   Example
     pts = randn(300, 3);
     pts = transformPoint3d(pts, createScaling3d([6 4 2]));
     pts = transformPoint3d(pts, createRotationOx(pi/6));
     pts = transformPoint3d(pts, createRotationOy(pi/4));
     pts = transformPoint3d(pts, createRotationOz(pi/3));
     pts = transformPoint3d(pts, createTranslation3d([5 4 3]));
     elli = equivalentEllipsoid(pts);
     figure; drawPoint3d(pts); axis equal;
     hold on; drawEllipsoid(elli, ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);

   See also
     spheres, drawEllipsoid, equivalentEllipse, principalAxes
     principalAxesTransform, rotation3dToEulerAngles

Package: matgeom