insphere.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_INSPHERE_H
  10. #define IGL_PREDICATES_INSPHERE_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 sphere.
  17. ///
  18. /// @param[in] pa 2D point on sphere
  19. /// @param[in] pb 2D point on sphere
  20. /// @param[in] pc 2D point on sphere
  21. /// @param[in] pd 2D point on sphere
  22. /// @param[in] pe 2D point query
  23. /// @return INSIDE if pe is inside of the sphere defined by pa, pb, pc and pd.
  24. /// OUSIDE if pe is outside of the sphere.
  25. /// COSPHERICAL pd is exactly on the sphere.
  26. ///
  27. /// \fileinfo
  28. template<typename Vector3D>
  29. IGL_INLINE Orientation insphere(
  30. const Eigen::MatrixBase<Vector3D>& pa,
  31. const Eigen::MatrixBase<Vector3D>& pb,
  32. const Eigen::MatrixBase<Vector3D>& pc,
  33. const Eigen::MatrixBase<Vector3D>& pd,
  34. const Eigen::MatrixBase<Vector3D>& pe);
  35. }
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. #include "insphere.cpp"
  39. #endif
  40. #endif