From f131444460c302d46ea15fb38f0801ec379bdc49 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Mon, 12 Dec 2022 17:34:43 +0100 Subject: [PATCH] Pyramid4: simplify computation of zcom --- Sample/HardParticle/Pyramid4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sample/HardParticle/Pyramid4.cpp b/Sample/HardParticle/Pyramid4.cpp index d72d91f09f6..4d087b858be 100644 --- a/Sample/HardParticle/Pyramid4.cpp +++ b/Sample/HardParticle/Pyramid4.cpp @@ -57,7 +57,7 @@ std::string Pyramid4::validate() const double b = a * (1 - r); // center of mass - double zcom = m_height * (1. / 4) * (6 - 8 * r + 3 * r * r) / (3 - 3 * r + r * r); + double zcom = m_height / 4 * (a * a + 2 * a * b + 3 * b * b) / (a * a + a * b + b * b); setPolyhedron(topology, -zcom, {// base: -- GitLab