I have a table of 3D Points and I need to find the best fit plane and its normal.
I have completed a series of steps see below, which results in 3 Vectors defined by three determinants, I have looked at these three vectors in my CAD application and V3 seems to be the closest result. The centroid is an exact match the the CAD, but I guess that's the easy step.
My question is, how do I use the determinants to decide which of the three vectors is the best result, or is that not the correct?
here is the resulting plane equation from the cad model
( -0.462337 * X ) + ( -0.873304 * Y ) + ( 0.153572 * Z ) = -0.026
Thanks
Madaxe
Step 1) Centroid (=SUM(A3:A11) * (1/9)) , (=SUM(B3:B11) * (1/9)) , (=SUM(C3:C11) * (1/9))
Step 2) Subtract the Centroid From Each Point (I think this is normalizing the point data).
Step 3) (Not sure what this step is doing)
Step 4) (Again not sure why or what were doing here, other than summing the previous step)
Step 5) Defining the determinants (this seems to be the cross product from the matrix from the previous step, guessing at this)
Step 6) Resulting Three vectors
I have completed a series of steps see below, which results in 3 Vectors defined by three determinants, I have looked at these three vectors in my CAD application and V3 seems to be the closest result. The centroid is an exact match the the CAD, but I guess that's the easy step.
My question is, how do I use the determinants to decide which of the three vectors is the best result, or is that not the correct?
here is the resulting plane equation from the cad model
( -0.462337 * X ) + ( -0.873304 * Y ) + ( 0.153572 * Z ) = -0.026
Thanks
Madaxe
Data | ||
x | y | z |
1 | 1 | 9 |
1 | 2 | 14 |
1 | 3 | 20 |
2 | 1 | 11 |
2 | 2 | 17 |
2 | 3 | 23 |
3 | 1 | 15 |
3 | 2 | 20 |
3 | 3 | 26 |
Step 1) Centroid (=SUM(A3:A11) * (1/9)) , (=SUM(B3:B11) * (1/9)) , (=SUM(C3:C11) * (1/9))
Centroid | ||
cx | cy | cz |
2 | 2 | 17.22222 |
Step 2) Subtract the Centroid From Each Point (I think this is normalizing the point data).
rx=x-cx | ry=y-cy | rz=z-cz |
-1 | -1 | -8.22222 |
-1 | 0 | -3.22222 |
-1 | 1 | 2.777778 |
0 | -1 | -6.22222 |
0 | 0 | -0.22222 |
0 | 1 | 5.777778 |
1 | -1 | -2.22222 |
1 | 0 | 2.777778 |
1 | 1 | 8.777778 |
Step 3) (Not sure what this step is doing)
rx.rx | rx.ry | rx.rz | ry.ry | ry.rz | rz.rz |
1 | 1 | 8.222222 | 1 | 8.222222 | 67.60494 |
1 | 0 | 3.222222 | 0 | 0 | 10.38272 |
1 | -1 | -2.77778 | 1 | 2.777778 | 7.716049 |
0 | 0 | 0 | 1 | 6.222222 | 38.71605 |
0 | 0 | 0 | 0 | 0 | 0.049383 |
0 | 0 | 0 | 1 | 5.777778 | 33.38272 |
1 | -1 | -2.22222 | 1 | 2.222222 | 4.938272 |
1 | 0 | 2.777778 | 0 | 0 | 7.716049 |
1 | 1 | 8.777778 | 1 | 8.777778 | 77.04938 |
Step 4) (Again not sure why or what were doing here, other than summing the previous step)
xx=Σrx.rx | xy=Σrx.ry | xz=Σrx.rz | yy=Σry.ry | yz=Σry.rz | zz=Σrz.rz |
6 | 0 | 18 | 6 | 34 | 247.5556 |
Step 5) Defining the determinants (this seems to be the cross product from the matrix from the previous step, guessing at this)
Determinants | |
det_x | 329.3333 |
det_y | 1377.333 |
det_z | 36 |
Step 6) Resulting Three vectors
Vectors | ||
v1 | v2 | v3 |
329.3333 | 612 | -108 |
612 | 1377.333 | -204 |
-108 | -204 | 36 |