Skip to content

Commit

Permalink
Fixed the sign in the central force
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Demidov committed Mar 11, 2024
1 parent d62551d commit 557600b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/central_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct central_force_functor {
std::vector<field_value_t> const & omega [[maybe_unused]],
real_t t [[maybe_unused]]) const {

field_value_t n = (x[i] - center_of_mass).normalized();
field_value_t n = (center_of_mass - x[i]).normalized();
field_value_t f = magnitude * n;

return std::make_pair(f / mass, zero_field);
Expand Down

0 comments on commit 557600b

Please sign in to comment.