I need to calculate the normal to an average plane using the positions of >3 points (for 3 points, I know how to do it with a cross-product). My main problem is that it needs to be a simple method without covariance matrices. It is for an Awk script and there is no library for fitting or matrix operations.
My idea would be:
- Calculate the cross-products between every possible combination of 3 points from a set of say, 10 points.
- Calculate the average cross-product.
Would that give me the normal to the average plane (or be a good approximation)? It may not be an elegant method, but it is easy and fast and Awk can do it.
Cheers
Your approach may be valid, although it depends on the distribution of points. You should be aware, that the cross products might be antiparallel, this at least should be corrected.
To find a point on the plane use the average of the points themselves, their "center of mass".