Plane fit

Fits a plane to a set of data points by minimizing the normal quadratic distance
Updated 4 Dec 2014

View License

Given a set of points (3D) this function computes the plane that fits best those points by minimizing the sum of the quadratic distances (perpendicular to the plane) between the plane and the points.
The fit is performed by computing the eigen-values/vectors associated to the distribution of points.

The code actually works in any dimension (>=2)

Nothing new, just classical linear algebra.

Cite As

Adrien Leygue (2024). Plane fit (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Quadratic Programming and Cone Programming in Help Center and MATLAB Answers

Inspired by: Plane Fitting and Normal Calculation

Inspired: threepoints2planez

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

added an example & screenshot