From 2a8b551355abd62b954fc52ab47fc67d8af608d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Oudin?= Date: Tue, 13 Feb 2018 10:49:12 +0100 Subject: [PATCH] Few bugs patched in spheroid. --- spheroid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spheroid.cpp b/spheroid.cpp index 60b2d94..bd2c9b2 100644 --- a/spheroid.cpp +++ b/spheroid.cpp @@ -13,7 +13,7 @@ Spheroid::Spheroid(const Point& _center, double _min_p, double _p, double _q) : } void Spheroid::_compute_volume() { - V = (4/3) * PI * p * q * q; + V = (4./3.) * PI * p * q * q; } @@ -32,7 +32,7 @@ void Spheroid::update_center_pos(Point& _center) { } void Spheroid::check_horizontal_plan_collision(double height) { - if (((center.y - p) <= height) || (p <= init_p)) { + if (((center.y - p) <= height) || (p < init_p)) { p = fmin(init_p, center.y-height); update_radius(); std::cout << "p:" << p << "q:" << q << '\n';