40 #ifndef GEOGRAM_NUMERICS_PREDICATES
41 #define GEOGRAM_NUMERICS_PREDICATES
106 const double* p0,
const double* p1,
132 const double* p0,
const double* p1,
const double* p2,
133 const double* q0,
const double* q1,
161 const double* p0,
const double* p1,
162 const double* p2,
const double* p3,
163 const double* q0,
const double* q1,
const double* q2,
194 const double* p0,
const double* p1,
195 const double* p2,
const double* p3,
196 double h0,
double h1,
double h2,
double h3,
197 const double* q0,
const double* q1,
const double* q2,
230 const double* p1,
const double* p2,
231 const double* p3,
const double* p4,
232 const double* q0,
const double* q1,
233 const double* q2,
const double* q3,
264 const double* p1,
const double* p2,
265 const double* p3,
const double* p4
294 const double* p0,
const double* p1,
295 const double* p2,
const double* p3,
const double* p4
314 const double* p0,
const double* p1,
315 const double* p2,
const double* p3,
336 const double* p0,
const double* p1,
const double* p2,
357 const double* p0,
const double* p1,
const double* p2,
386 const double* p0,
const double* p1,
const double* p2,
388 double h0,
double h1,
double h2,
double h3,
402 const double* p0,
const double* p1,
const double* p2
442 const double* p0,
const double* p1,
443 const double* p2,
const double* p3,
444 double h0,
double h1,
double h2,
double h3
458 const double* p0,
const double* p1,
459 const double* p2,
const double* p3
499 const double* p0,
const double* p1,
500 const double* p2,
const double* p3,
const double* p4,
501 double h0,
double h1,
double h2,
double h3,
double h4
525 const double* p0,
const double* p1,
526 const double* p2,
const double* p3,
const double* p4,
527 double h0,
double h1,
double h2,
double h3,
double h4
538 const double* p0,
const double* p1,
const double* p2
562 const double* p0,
const double* p1,
563 const double* p2,
const double* p3
590 const double* p0,
const double* p1,
591 const double* p2,
const double* p3,
604 const double* p0,
const double* p1,
const double* p2
615 const double* p0,
const double* p1,
const double* p2
654 const double* v0,
const double* v1,
const double* v2
710 const double* p0,
const double* p1,
711 const double* p2,
const double* p3
713 double a11 = p1[0] - p0[0] ;
714 double a12 = p1[1] - p0[1] ;
715 double a13 = p1[2] - p0[2] ;
717 double a21 = p2[0] - p0[0] ;
718 double a22 = p2[1] - p0[1] ;
719 double a23 = p2[2] - p0[2] ;
721 double a31 = p3[0] - p0[0] ;
722 double a32 = p3[1] - p0[1] ;
723 double a33 = p3[2] - p0[2] ;
Utilities to write geometric predicates (Predicate Construction Kit).
T * data()
Gets modifiable vector data.
Common include file, providing basic definitions. Should be included before anything else by all head...
Geometric functions in 2d and 3d.
Sign det_4d(const double *p0, const double *p1, const double *p2, const double *p3)
Computes the sign of the determinant of a 4x4 matrix formed by four 4d points.
Sign in_circle_3dlifted_SOS(const double *p0, const double *p1, const double *p2, const double *p3, double h0, double h1, double h2, double h3, bool SOS=true)
Tests whether a lifted 3d point is inside the circumscribed circle of a lifted 3d triangle.
Sign orient_3dlifted(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4, double h0, double h1, double h2, double h3, double h4)
Computes the 4d orientation test.
Sign dot_compare_3d(const double *v0, const double *v1, const double *v2)
Compares two dot products.
Sign side3_SOS(const double *p0, const double *p1, const double *p2, const double *p3, const double *q0, const double *q1, const double *q2, coord_index_t DIM)
Computes the side of a point (given as the intersection between a facet and two bisectors) relative t...
Sign orient_3dlifted_SOS(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4, double h0, double h1, double h2, double h3, double h4)
Computes the 4d orientation test with symbolic perturbation.
Sign side4_3d_SOS(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4)
Computes the side of a point (given as the intersection between three bisectors) relative to another ...
Sign in_circle_2d_SOS(const double *p0, const double *p1, const double *p2, const double *p3)
Tests whether a 2d point is inside the circumscribed circle of a 3d triangle.
Sign orient_2dlifted_SOS(const double *p0, const double *p1, const double *p2, const double *p3, double h0, double h1, double h2, double h3)
Computes the 3d orientation test with lifted points.
Sign orient_3d_inexact(const double *p0, const double *p1, const double *p2, const double *p3)
Computes the (approximate) orientation predicate in 3d.
Sign in_circle_3d_SOS(const double *p0, const double *p1, const double *p2, const double *p3)
Tests whether a 3d point is inside the circumscribed circle of a 3d triangle.
Sign in_sphere_3d_SOS(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4)
Tests whether a 3d point is inside the circumscribed sphere of a 3d tetrahedron.
Sign side4_SOS(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4, const double *q0, const double *q1, const double *q2, const double *q3, coord_index_t DIM)
Computes the side of a point (given as the intersection between a tetrahedron and three bisectors) re...
void show_stats()
Displays some statistics about predicates, including the number of calls, the number of exact arithme...
Sign orient_2d(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2)
Computes the orientation predicate in 2d.
Sign SOS(COMPARE compare, const POINT &p1, FUNC1 sos_p1, const POINT &p2, FUNC2 sos_p2, const POINT &p3, FUNC3 sos_p3, const POINT &p4, FUNC4 sos_p4)
template for writing symbolic perturbation in predicates
Sign det_3d(const double *p0, const double *p1, const double *p2)
Computes the sign of the determinant of a 3x3 matrix formed by three 3d points.
Sign det_compare_4d(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4)
Computes the sign of the determinant of a 4x4 matrix formed by three 4d points and the difference of ...
Sign side4_3d(const double *p0, const double *p1, const double *p2, const double *p3, const double *p4)
Computes the side of a point (given as the intersection between three bisectors) relative to another ...
Sign dot_3d(const double *p0, const double *p1, const double *p2)
Computes the sign of the dot product between two vectors.
bool points_are_identical_3d(const double *p1, const double *p2)
Tests whether two 3d points are identical.
SOSMode
Mode for symbolic perturbations.
bool points_are_colinear_3d(const double *p1, const double *p2, const double *p3)
Tests whether three 3d points are colinear.
Sign side2_SOS(const double *p0, const double *p1, const double *p2, const double *q0, const double *q1, coord_index_t DIM)
Computes the side of a point (given as the intersection between a segment and a bisector) relative to...
bool points_are_identical_2d(const double *p1, const double *p2)
Tests whether two 2d points are identical.
Sign side3_3dlifted_SOS(const double *p0, const double *p1, const double *p2, const double *p3, double h0, double h1, double h2, double h3, const double *q0, const double *q1, const double *q2, bool SOS=true)
Computes the side of a point (given as the intersection between a facet and two bisectors) relative t...
Sign side1_SOS(const double *p0, const double *p1, const double *q0, coord_index_t DIM)
Computes the side of a point (given directly) relative to a bisector.
void initialize()
Needs to be called before using any predicate.
void terminate()
Needs to be called at the end of the program.
bool aligned_3d(const vec3HE &p0, const vec3HE &p1, const vec3HE &p2)
Tests whether three 3d points are aligned.
Sign orient_3d(const vec3HE &p0, const vec3HE &p1, const vec3HE &p2, const vec3HE &p3)
Computes the orientation predicate in 3d.
SOSMode get_SOS_mode()
Gets the current mode for handling symbolic perturbations.
void set_SOS_mode(SOSMode m)
Sets the current mode for handling symbolic perturbations (SOS for Simulation Of Simplicity).
Global Vorpaline namespace.
T det3x3(const T &a11, const T &a12, const T &a13, const T &a21, const T &a22, const T &a23, const T &a31, const T &a32, const T &a33)
Computes a three-by-three determinant.
Sign geo_sgn(const T &x)
Gets the sign of a value.
Sign
Integer constants that represent the sign of a value.
geo_coord_index_t coord_index_t
The type for storing coordinate indices, and iterating on the coordinates of a point.
Types and functions for numbers manipulation.