Fix PCA for Iso_cuboid_3 volumic

This commit is contained in:
Simon Giraudot 2020-10-29 15:11:03 +01:00
parent 5e727465eb
commit 5c39c3bd24
1 changed files with 3 additions and 3 deletions

View File

@ -175,9 +175,9 @@ assemble_covariance_matrix_3(InputIterator first,
transformation = volume * transformation * moment * transformation.transpose();
// Translate the 2nd order moment to the minimum corner (x0,y0,z0) of the cuboid.
FT xav0 = (x1 - x0) / (4.0);
FT yav0 = (y1 - y0) / (4.0);
FT zav0 = (z1 - z0) / (4.0);
FT xav0 = (x1 - x0) / (2.0);
FT yav0 = (y1 - y0) / (2.0);
FT zav0 = (z1 - z0) / (2.0);
// and add to covariance matrix
covariance[0] += transformation(0,0) + volume * (2*x0*xav0 + x0*x0);