rotate_vectors.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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. #ifndef IGL_ROTATE_VECTORS_H
  9. #define IGL_ROTATE_VECTORS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Rotate the vectors V by A radiants on the tangent plane spanned by B1 and B2
  15. // Inputs:
  16. // V #V by 3 eigen Matrix of vectors
  17. // A #V eigen vector of rotation angles or a single angle to be applied to all vectors
  18. // B1 #V by 3 eigen Matrix of base vector 1
  19. // B2 #V by 3 eigen Matrix of base vector 2
  20. //
  21. // Output:
  22. // Returns the rotated vectors
  23. //
  24. IGL_INLINE Eigen::MatrixXd rotate_vectors(
  25. const Eigen::MatrixXd& V,
  26. const Eigen::VectorXd& A,
  27. const Eigen::MatrixXd& B1,
  28. const Eigen::MatrixXd& B2);
  29. }
  30. #ifdef IGL_HEADER_ONLY
  31. # include "rotate_vectors.cpp"
  32. #endif
  33. #endif