Ellipsoid fit

Version (4.01 KB) by Yury
Fits an ellipsoid / sphere / paraboloid / hyperboloid to data using linear least squares.
Updated 4 Dec 2015

View License

Fits an ellipsoid or other conic surface into a 3D set of points approximating such a surface, allows some constraints, like orientation constraint and equal radii constraint. E.g., you can use it to fit a rugby ball, or a sphere. 'help ellipsoid_fit' says it all. Returns both the algebraic description of the ellipsoid (the nine coefficients of the quadratic form) and the geometric description (center, radii, principal axes).

Cite As

Yury (2024). Ellipsoid fit (https://www.mathworks.com/matlabcentral/fileexchange/24693-ellipsoid-fit), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Updated the function to give correct radii and chi2 when fitting other conics beside ellipsoids.
Indicated that the code fits surfaces, not volumes.

Fixed instability arising for data points near zero.
Added equal radii constraints for an ellipsoid of an arbitrary orientation.

Just a better description.