Fixed inertia for rectangles

This commit is contained in:
Karma Riuk 2023-04-10 14:39:36 +02:00
parent d0de911344
commit c7b9500bc4

View File

@ -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};
}