fit_rigid.cpp 638 B

123456789101112131415161718192021
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "fit_rigid.h"
  9. #include "procrustes.h"
  10. IGL_INLINE void igl::fit_rigid(
  11. const Eigen::MatrixXd & A,
  12. const Eigen::MatrixXd & B,
  13. Eigen::Rotation2Dd & R,
  14. Eigen::RowVector2d & t)
  15. {
  16. using namespace Eigen;
  17. Matrix2d Rmat;
  18. procrustes(A,B,Rmat,t);
  19. R.fromRotationMatrix(Rmat);
  20. }