title: Python: fit 3D ellipsoid (oblate/prolate) to 3D points
body: <p>Dear fellow stackoverflow users,</p>
  
  <p>I face a problem as follows: I would like to fit a 3D ellipsoid to 3D data points within my python script.</p>
  
  <p>The starting data are a set of x, y and z coordinates (cartesian coordinates). What I would like to get are a and c in the defining equation of the best-fit ellipsoid of the convex hull of the 3D data points.</p>
  
  <p>The equation is, in the properly rotated and translated coordinate system:</p>
  
  <p><img src="https://i.imgur.com/6H7XpU6.gif" alt="ellipsoid equation"></p>
  
  <p>So the tasks I would ideally like to do are:</p>
  
  <ol>
  <li><p>Find convex hull of 3D data points</p></li>
  <li><p>Fit best-fit ellipsoid to the convex hull and get a and c</p></li>
  </ol>
  
  <p>Do you know whether there is some library allowing to do this in Python with minimal lines of code? Or do I have to explicitly code every of these steps with my limited math knowledge (which essentially amounts to zero when it comes to find best fit ellipsoid)?</p>
  
  <p>Thanks in advance for your help and have a nice day!</p>