fit_rigid.cpp 613 B

1234567891011121314151617181920
  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. Matrix2d Rmat;
  17. procrustes(A,B,Rmat,t);
  18. R.fromRotationMatrix(Rmat);
  19. }