require.mx('mxjs/base/math/fit_line_kd.js');
Fit a line to a collection of points, in k-dimensions (for limited values of k).
Status | Name |
---|---|
Boolean fitLine3D
(
vec3 ↑mean,
vec3 ↑normalDir,
Number pointsBegin,
Number pointsEnd,
Function readPoint
)
Fit a line to a collection of 3D points. |
|
Boolean fitLine4D
(
vec4 ↑mean,
vec4 ↑normalDir,
Number pointsBegin,
Number pointsEnd,
Function readPoint
)
Fit a line to a collection of 4D points. |
Fit a line to a collection of 3D points.
Parameters:vec3
↑mean - receives the mean value of all input pointsvec3
↑normalDir - receives the normal direction of the fitted lineNumber
pointsBegin - first row number for pointsNumber
pointsEnd - terminating row number for points (stop reading before this number)Function
readPoint - function(index,output_point) reads the point at row index into the provided output_pointBoolean
result - true if the line was fitFit a line to a collection of 4D points.
Parameters:vec4
↑mean - receives the mean value of all input pointsvec4
↑normalDir - receives the normal direction of the fitted lineNumber
pointsBegin - first row number for pointsNumber
pointsEnd - terminating row number for points (stop reading before this number)Function
readPoint - function(index,output_point) reads the point at row index into the provided output_pointBoolean
result - true if the line was fit