Fit a plane to a set of xyz points

Is there a simple function call for this? And finding the distance of
a point to the plane?

-Mathew

2010/7/26 Mathew Yeates <mat.yeates@...287...>:

Is there a simple function call for this? And finding the distance of
a point to the plane?

Hmm, when you are interested in the z distance alone, it should be a
matrix equation:

Z = X * m_x + Y * m_y + 1 * n

Meaning you can invert it with Moore-Penrose pseudoinversion, i.e.,
numpy.lstsq()?

When you have weights on Z, normalise first.

Friedrich