diff --git a/src/potential/point_mass/potential.h b/src/potential/point_mass/potential.h index 9f7533d80e713f628ebd7babe720ffd0064cea4e..5f3d1c27b85c4f1353481e6351fba47aff62d66f 100644 --- a/src/potential/point_mass/potential.h +++ b/src/potential/point_mass/potential.h @@ -133,7 +133,7 @@ external_gravity_get_potential_energy( const float dy = g->x[1] - potential->y; const float dz = g->x[2] - potential->z; const float rinv = 1. / sqrtf(dx * dx + dy * dy + dz * dz); - return -phys_const->const_newton_G * potential->mass * r_inv; + return -phys_const->const_newton_G * potential->mass * rinv; } /**