BRL-CAD
|
Functions | |
int | bg_pca (point_t *c, vect_t *xaxis, vect_t *yaxis, vect_t *zaxis, size_t npnts, point_t *pnts) |
Perform a Principle Component Analysis on a set of points. | |
Principle Component Analysis
Calculates an XYZ coordinate system such that it aligns with the largest variations in the supplied data. Intuitively, it "aligns" with the shape of the points.
To apply the coordinate system to the input points to relocate them to the aligned position in model space, you can construct matrices and apply them:
|
extern |
Perform a Principle Component Analysis on a set of points.
Outputs are a center point and XYZ vectors for the coordinate system.
[out] | c | Origin of aligned coordinate system |
[out] | xaxis | Vector of X axis of aligned coordinate system (unit length) |
[out] | yaxis | Vector of Y axis of aligned coordinate system (unit length) |
[out] | zaxis | Vector of Z axis of aligned coordinate system (unit length) |
[in] | npnts | Number of points in input pnts array |
[in] | pnts | Array of points to analyze |