Skip to content

Commit

Permalink
fix: Centripetal force for parallel axes shall be null
Browse files Browse the repository at this point in the history
  • Loading branch information
sanguinariojoe committed Aug 7, 2024
1 parent d4cce8e commit 829c837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/Point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Point::getCentripetalForce(vec rRef, vec w) const
{
const vec rRel = r - rRef;

return w.squaredNorm() * (M * rRel);
return -M * (w.cross(w.cross(rRel)));
}

moordyn::error_id
Expand Down
2 changes: 1 addition & 1 deletion source/Rod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ Rod::getCentripetalForce(vec rRef, vec w) const
vec F = vec::Zero();
for (unsigned int i = 0; i <= N; i++) {
const vec rRel = r[i] - rRef;
F += w.squaredNorm() * (M[i] * rRel);
F -= M[i] * (w.cross(w.cross(rRel)));
}
return F;
}
Expand Down

0 comments on commit 829c837

Please sign in to comment.