super_fibonacci.h 975 B

123456789101112131415161718192021222324252627282930313233
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2025 Alec Jacobson <[email protected]>
  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_SUPER_FIBONACCI_H
  9. #define IGL_SUPER_FIBONACCI_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <Eigen/Geometry>
  13. #include <vector>
  14. namespace igl
  15. {
  16. /// super_fibonacci Generate n quaternions according to "Super-Fibonacci
  17. /// Spirals: Fast, Low-Discrepancy Sampling of SO(3)" [Alexa 2021]
  18. ///
  19. ///
  20. /// @param[in] n number of rotations to generate
  21. /// @param[out] q n by 4list of unit quaternions
  22. template <typename DerivedQ>
  23. IGL_INLINE void super_fibonacci(
  24. const int n,
  25. Eigen::PlainObjectBase<DerivedQ> & Q);
  26. }
  27. #ifndef IGL_STATIC_LIBRARY
  28. #include "super_fibonacci.cpp"
  29. #endif
  30. #endif