Skip to content

Commit

Permalink
Merge pull request #4 from Eddy-Morgan/main
Browse files Browse the repository at this point in the history
fixed restoring forces formulation
  • Loading branch information
evan-palmer authored May 26, 2024
2 parents 593820c + 2717b71 commit 3244aa8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hydrodynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ Eigen::Vector6d RestoringForces::calculateRestoringForcesVector(const Eigen::Mat

Eigen::Vector6d g_rb;

g_rb.topRows(3) = rot * (fg + fb);
g_rb.bottomRows(3) = center_of_gravity_.cross(rot * fg) + center_of_buoyancy_.cross(rot * fb);
const Eigen::Matrix3d rot_t = rot.transpose();

g_rb.topRows(3) = rot_t * (fg + fb);
g_rb.bottomRows(3) = center_of_gravity_.cross(rot_t * fg) + center_of_buoyancy_.cross(rot_t * fb);

g_rb *= -1;

Expand Down

0 comments on commit 3244aa8

Please sign in to comment.