solid_angle.h 832 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_SOLID_ANGLE_H
  2. #define IGL_SOLID_ANGLE_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. namespace igl
  6. {
  7. /// Compute the signed solid angle subtended by the oriented 3d triangle (A,B,C) at some point P
  8. ///
  9. /// @param[in] A 3D position of corner
  10. /// @param[in] B 3D position of corner
  11. /// @param[in] C 3D position of corner
  12. /// @param[in] P 3D position of query point
  13. /// @return signed solid angle
  14. template <
  15. typename DerivedA,
  16. typename DerivedB,
  17. typename DerivedC,
  18. typename DerivedP>
  19. IGL_INLINE typename DerivedA::Scalar solid_angle(
  20. const Eigen::MatrixBase<DerivedA> & A,
  21. const Eigen::MatrixBase<DerivedB> & B,
  22. const Eigen::MatrixBase<DerivedC> & C,
  23. const Eigen::MatrixBase<DerivedP> & P);
  24. }
  25. #ifndef IGL_STATIC_LIBRARY
  26. # include "solid_angle.cpp"
  27. #endif
  28. #endif