Skip to content

Commit

Permalink
Fix wrong exponent of pow in eval_force
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Jun 9, 2019
1 parent 3eeae76 commit 795a610
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions misc/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ array<double, 3> eval_force(const double * r1, double m1, const double * r2, dou
double norm = 0;
for(int c = 0; c < 3; c++){
norm += pow(r1[c] - r2[c], 2);

}


for(int c = 0; c < 3; c++){
f[c] = M * (r1[c] - r2[c]);
f[c] /= pow(norm, 3/2);
f[c] /= pow(norm, 3.0 / 2.0);
}
return f;
}

0 comments on commit 795a610

Please sign in to comment.