From c7b9500bc4ad4281af6e08886cbfad1c7cd14f36 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 10 Apr 2023 14:39:36 +0200 Subject: [PATCH] Fixed inertia for rectangles --- polygon_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polygon_generator.cc b/polygon_generator.cc index 4d7e1a2..d234c0b 100644 --- a/polygon_generator.cc +++ b/polygon_generator.cc @@ -18,7 +18,7 @@ polygon poly_generate::rectangle(double width, double height, double mass) { {-width / 2, height / 2}, {width / 2, height / 2}, {width / 2, -height / 2}}, - one_over_twelve * mass * width * std::pow(height, 3), + one_over_twelve * mass * (width * width + height * height), mass}; }