orient2D.h 968 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingan Zhou <qnzhou@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_COPYLEFT_CGAL_ORIENT_2D_H
  9. #define IGL_COPYLEFT_CGAL_ORIENT_2D_H
  10. #include "../../igl_inline.h"
  11. namespace igl
  12. {
  13. namespace copyleft
  14. {
  15. namespace cgal
  16. {
  17. // Inputs:
  18. // pa,pb,pc 2D points.
  19. // Output:
  20. // 1 if pa,pb,pc are counterclockwise oriented.
  21. // 0 if pa,pb,pc are counterclockwise oriented.
  22. // -1 if pa,pb,pc are clockwise oriented.
  23. template <typename Scalar>
  24. IGL_INLINE short orient2D(
  25. const Scalar *pa,
  26. const Scalar *pb,
  27. const Scalar *pc);
  28. }
  29. }
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "orient2D.cpp"
  33. #endif
  34. #endif