so it seems the optimization for minimum area is to maximize, rather than minimize, log(det(A)).

Also, for small d, it may be easier to obtain semi major/minor lengths (a, b) by finding the eigenvalues/vectors of A (eigenvalues are 1/a^2, 1/b^2, etc, rotation matrix columns are the eigenvectors).

I'm finding this algorithm gives me det(A) < 0 (a hyperbola) for some point sets. Also, A should be invariant under translation of all the input points (which should just result in a translation of c), but I find it is quite sensitive.

thanks for sharing the code it's really good. One question, please could you explain me which it's the differente between this method and least squares?