Fitting a plane to 4 points: analytical and iterative solutions resulting in poor fits

1.1k Views Asked by At

I have the following set of 4 Cartesian coordinates:

coords = [3.64811 7.61531 9.05108; 3.53604 4.82801 9.05108; 3.53604 4.82801 6.34192; 3.64811 7.61531 6.34192]

I am trying to fit a plane of the form $ax+by+c=z$ to these 4 coordinates. I tried both the analytical least-squares solution, as described here, and an iterative approach described here. These both result in relatively high root-mean-square-errors but I am not sure why. Using the curve fitting toolbox in MATLAB results in an $r^2$ that's negative and notes that the equation is badly conditioned, although visually the resulting fit looks okay somehow (image below).

It is rather intuitive what the plane should be. What can I do to get a more accurate solution? Mathematically, what is the issue with this set of coordinates?

enter image description here

1

There are 1 best solutions below

3
On BEST ANSWER

The problem is that the four points lie on a plane that is vertical. i.e. you can write it as

$$2.78730x-0.11207y-9.3149292113 = 0.$$

So you won't be able to fit a plane of the form $$ax+by+c=z$$ to these points.