point_in_circle.h 972 B

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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_POINT_IN_CIRCLE_H
  9. #define IGL_POINT_IN_CIRCLE_H
  10. #include "igl_inline.h"
  11. namespace igl
  12. {
  13. // Determine if 2d point is in a circle
  14. // Inputs:
  15. // qx x-coordinate of query point
  16. // qy y-coordinate of query point
  17. // cx x-coordinate of circle center
  18. // cy y-coordinate of circle center
  19. // r radius of circle
  20. // Returns true if query point is in circle, false otherwise
  21. IGL_INLINE bool point_in_circle(
  22. const double qx,
  23. const double qy,
  24. const double cx,
  25. const double cy,
  26. const double r);
  27. }
  28. #ifndef IGL_STATIC_LIBRARY
  29. # include "point_in_circle.cpp"
  30. #endif
  31. #endif