AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
in_sphere.hpp File Reference

Consists of methods that test whether a given query point is inside the unique sphere circumscribing a 2D triangle or a 3D tetrahedron. More...

#include "axom/core.hpp"
#include "axom/primal/geometry/Point.hpp"
#include "axom/primal/geometry/Triangle.hpp"
#include "axom/primal/geometry/Tetrahedron.hpp"
#include "axom/primal/geometry/OrientationResult.hpp"
#include "axom/primal/operators/detail/predicate_determinants.hpp"

Namespaces

 axom
 
 axom::primal
 

Functions

template<typename T >
double axom::primal::in_sphere_determinant (const Point< T, 2 > &q, const Point< T, 2 > &p0, const Point< T, 2 > &p1, const Point< T, 2 > &p2)
 Returns the raw 2D in-sphere determinant for a circumcircle test. More...
 
template<typename T >
double axom::primal::in_sphere_determinant (const Point< T, 2 > &q, const Triangle< T, 2 > &tri)
 
template<typename T >
double axom::primal::in_sphere_determinant (const Point< T, 3 > &q, const Point< T, 3 > &p0, const Point< T, 3 > &p1, const Point< T, 3 > &p2, const Point< T, 3 > &p3)
 Returns the raw 3D in-sphere determinant for a circumsphere test. More...
 
template<typename T >
double axom::primal::in_sphere_determinant (const Point< T, 3 > &q, const Tetrahedron< T, 3 > &tet)
 
template<typename T >
int axom::primal::in_sphere_orientation (const Point< T, 2 > &q, const Point< T, 2 > &p0, const Point< T, 2 > &p1, const Point< T, 2 > &p2, double EPS=1e-8)
 Classifies a query point against a 2D triangle's circumcircle. More...
 
template<typename T >
int axom::primal::in_sphere_orientation (const Point< T, 2 > &q, const Triangle< T, 2 > &tri, double EPS=1e-8)
 
template<typename T >
int axom::primal::in_sphere_orientation (const Point< T, 3 > &q, const Point< T, 3 > &p0, const Point< T, 3 > &p1, const Point< T, 3 > &p2, const Point< T, 3 > &p3, double EPS=1e-8)
 Classifies a query point against a 3D tetrahedron's circumsphere. More...
 
template<typename T >
int axom::primal::in_sphere_orientation (const Point< T, 3 > &q, const Tetrahedron< T, 3 > &tet, double EPS=1e-8)
 
template<typename T >
bool axom::primal::in_sphere (const Point< T, 2 > &q, const Point< T, 2 > &p0, const Point< T, 2 > &p1, const Point< T, 2 > &p2, double EPS=1e-8, bool includeBoundary=false)
 Tests whether a query point lies inside a 2D triangle's circumcircle. More...
 
template<typename T >
bool axom::primal::in_sphere (const Point< T, 2 > &q, const Triangle< T, 2 > &tri, double EPS=1e-8, bool includeBoundary=false)
 Tests whether a query point lies inside a 2D triangle's circumcircle. More...
 
template<typename T >
bool axom::primal::in_sphere (const Point< T, 3 > &q, const Point< T, 3 > &p0, const Point< T, 3 > &p1, const Point< T, 3 > &p2, const Point< T, 3 > &p3, double EPS=1e-8, bool includeBoundary=false)
 Tests whether a query point lies inside a 3D tetrahedron's circumsphere. More...
 
template<typename T >
bool axom::primal::in_sphere (const Point< T, 3 > &q, const Tetrahedron< T, 3 > &tet, double EPS=1e-8, bool includeBoundary=false)
 Tests whether a query point lies inside a 3D tetrahedron's circumsphere. More...
 
template<typename T >
bool axom::primal::in_sphere (const BoundingBox< T, 2 > &bb, const Sphere< T, 2 > &circle)
 Tests whether a bounding box lies inside a 2D sphere. More...
 

Detailed Description

Consists of methods that test whether a given query point is inside the unique sphere circumscribing a 2D triangle or a 3D tetrahedron.

This is a well known computational geometry primitive. For reference, see Section 3.1.6.4 in "Real-time collision detection" by C. Ericson.

Note
These routines use double-precision determinants and are not exact sign oracles near degeneracy (e.g. nearly co-circular/co-spherical inputs). See detail/predicate_determinants.hpp for the precision/robustness discussion and in_sphere_orientation() for the tolerance (EPS) scaling caveat.