diff --git a/spheroid.cpp b/spheroid.cpp index ef9f381..2c0a60b 100644 --- a/spheroid.cpp +++ b/spheroid.cpp @@ -51,3 +51,10 @@ void Spheroid::check_vertical_plan_collision(double& abscissa) { } } } + + +double Spheroid::operator() (double _x, double _y, double _z) const { + return (pow(_x - center.x, 2) / pow(q, 2) + + pow(_y - center.y, 2) / pow(q, 2) + + pow(_z - center.z, 2) / pow(p, 2) -1); + } diff --git a/spheroid.hpp b/spheroid.hpp index 66b2aec..ca74894 100644 --- a/spheroid.hpp +++ b/spheroid.hpp @@ -19,11 +19,7 @@ class Spheroid : public ImplicitSurface { void set_stiffness(size_t _stiffness); void check_horizontal_plan_collision(double& height); void check_vertical_plan_collision(double& abscissa); - double operator() (double _x, double _y, double _z) const { - return (pow(_x - center.x, 2) / pow(q, 2) - + pow(_y - center.y, 2) / pow(q, 2) - + pow(_z - center.z, 2) / pow(p, 2) -1); - } + double operator() (double _x, double _y, double _z) const; private: /** * p corresponds to the half-height of the ball,