line_segment_in_rectangle.h 656 B

12345678910111213141516171819202122232425
  1. #ifndef IGL_LINE_SEGMENT_IN_RECTANGLE_H
  2. #define IGL_LINE_SEGMENT_IN_RECTANGLE_H
  3. #include <Eigen/Core>
  4. namespace igl
  5. {
  6. // Determine whether a line segment overlaps with a rectangle.
  7. //
  8. // Inputs:
  9. // s source point of line segment
  10. // d dest point of line segment
  11. // A first corner of rectangle
  12. // B opposite corner of rectangle
  13. // Returns true if line segment is at all inside rectangle
  14. bool line_segment_in_rectangle(
  15. const Eigen::Vector2d & s,
  16. const Eigen::Vector2d & d,
  17. const Eigen::Vector2d & A,
  18. const Eigen::Vector2d & B);
  19. }
  20. #ifdef IGL_HEADER_ONLY
  21. # include "line_segment_in_rectangle.cpp"
  22. #endif
  23. #endif