insphere.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingan 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. #ifndef IGL_COPYLEFT_CGAL_INSPHERE_H
  9. #define IGL_COPYLEFT_CGAL_INSPHERE_H
  10. #include "../../igl_inline.h"
  11. namespace igl
  12. {
  13. namespace copyleft
  14. {
  15. namespace cgal
  16. {
  17. /// Test whether point is in a given sphere.
  18. ///
  19. /// @param[in] pa 3D point on sphere
  20. /// @param[in] pb 3D point on sphere
  21. /// @param[in] pc 3D point on sphere
  22. /// @param[in] pd 3D point on sphere
  23. /// @param[in] pe 3D point to test
  24. /// @return 1 if pe is inside of the oriented sphere formed by pa,pb,pc,pd,
  25. /// 0 if pe is co-spherical with pa,pb,pc,pd,
  26. /// -1 if pe is outside of the oriented sphere formed by pa,pb,pc,pd.
  27. ///
  28. template <typename Scalar>
  29. IGL_INLINE short insphere(
  30. const Scalar pa[3],
  31. const Scalar pb[3],
  32. const Scalar pc[3],
  33. const Scalar pd[3],
  34. const Scalar pe[3]);
  35. }
  36. }
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "insphere.cpp"
  40. #endif
  41. #endif