solid_angle.h 802 B

1234567891011121314151617181920212223242526272829
  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. // Inputs:
  10. // A 3D position of corner
  11. // B 3D position of corner
  12. // C 3D position of corner
  13. // P 3D position of query point
  14. // Returns signed solid angle
  15. template <
  16. typename DerivedA,
  17. typename DerivedB,
  18. typename DerivedC,
  19. typename DerivedP>
  20. IGL_INLINE typename DerivedA::Scalar solid_angle(
  21. const Eigen::MatrixBase<DerivedA> & A,
  22. const Eigen::MatrixBase<DerivedB> & B,
  23. const Eigen::MatrixBase<DerivedC> & C,
  24. const Eigen::MatrixBase<DerivedP> & P);
  25. }
  26. #ifndef IGL_STATIC_LIBRARY
  27. # include "solid_angle.cpp"
  28. #endif
  29. #endif