From 9cc45f7c5ebda066f2741a2d485116e57291cf13 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Mon, 14 Sep 2020 11:43:54 +0200 Subject: [PATCH] Fix incorrect moment matrix for Iso_cuboid_3 --- Principal_component_analysis/include/CGAL/PCA_util_Eigen.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h b/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h index f6803638e32..dfabb50a0b0 100644 --- a/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h +++ b/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h @@ -144,9 +144,9 @@ assemble_covariance_matrix_3(InputIterator first, FT x0 = t[0].x(); FT y0 = t[0].y(); FT z0 = t[0].z(); - FT delta[9] = {t[0].x(), t[1].x(), t[2].x(), - t[0].y(), t[1].y(), t[2].y(), - t[0].z(), t[1].z(), t[2].z()}; + FT delta[9] = {t[1].x()-x0, t[3].x()-x0, t[5].x()-x0, + t[1].y()-y0, t[3].y()-y0, t[5].y()-y0, + t[1].z()-z0, t[3].z()-z0, t[5].z()-z0}; Matrix transformation (delta); FT volume = t.volume();