Planar regression calculates the best fit plane through 3 or more data points by minimizing the residuals between the plane and points using least squares minimization. The equation for the plane is determined by taking the derivative of the residuals equation and setting it equal to zero, yielding a system of equations that can be expressed in matrix form and solved for the plane coefficients.