The function linear_least_squares_fitting_3 computes the best fitting 3D line or plane of 3D point sets or triangle sets. The best fit linear sub-space minimizes the sum of squared distances from the points to their projections onto the sub-space.
#include <CGAL/linear_least_squares_fitting_3.h>
| ||||
|
| |||
computes the best fitting 3D line of a 3D point set or triangle set in the range [first,beyond). The value returned is a fitting quality between and , where means that the variance is the same along any line (a horizontal line going through the centroid is output by default), and means that the variance is null orthogonally to the best fitting line. |
The class K is the kernel in which the type InputIterator::value_type is defined. It can be omitted and deduced automatically from the value type.
| ||||
|
| |||
computes the best fitting 3D plane of a 3D point set or triangle set in the range [first,beyond). The value returned is a fitting quality between and , where means that the variance is the same along any plane (a horizontal plane going through the centroid is output by default), and means that the variance is null orthogonally to the best fitting plane. |
The class K is the kernel in which the type InputIterator::value_type is defined. It can be omitted and deduced automatically from the value type.