incircle.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2019 Qingnan Zhou <[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. #pragma once
  9. #ifndef IGL_PREDICATES_INCIRCLE_H
  10. #define IGL_PREDICATES_INCIRCLE_H
  11. #include "../igl_inline.h"
  12. #include <Eigen/Core>
  13. #include "Orientation.h"
  14. namespace igl {
  15. namespace predicates {
  16. /// Decide whether a point is inside/outside/on a circle.
  17. ///
  18. /// @param[in] pa 2D point on circle
  19. /// @param[in] pb 2D point on circle
  20. /// @param[in] pc 2D point on circle
  21. /// @param[in] pd 2D point query
  22. /// @return INSIDE if pd is inside of the circle defined by pa, pb and pc.
  23. /// OUSIDE if pd is outside of the circle.
  24. /// COCIRCULAR pd is exactly on the circle.
  25. ///
  26. /// \fileinfo
  27. template<typename Vector2D>
  28. IGL_INLINE Orientation incircle(
  29. const Eigen::MatrixBase<Vector2D>& pa,
  30. const Eigen::MatrixBase<Vector2D>& pb,
  31. const Eigen::MatrixBase<Vector2D>& pc,
  32. const Eigen::MatrixBase<Vector2D>& pd);
  33. }
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. #include "incircle.cpp"
  37. #endif
  38. #endif