40#ifndef GEOGRAM_NUMERICS_PREDICATES
41#define GEOGRAM_NUMERICS_PREDICATES
108 const double* p0,
const double* p1,
134 const double* p0,
const double* p1,
const double* p2,
135 const double* q0,
const double* q1,
163 const double* p0,
const double* p1,
164 const double* p2,
const double* p3,
165 const double* q0,
const double* q1,
const double* q2,
196 const double* p0,
const double* p1,
197 const double* p2,
const double* p3,
198 double h0,
double h1,
double h2,
double h3,
199 const double* q0,
const double* q1,
const double* q2,
232 const double* p1,
const double* p2,
233 const double* p3,
const double* p4,
234 const double* q0,
const double* q1,
235 const double* q2,
const double* q3,
266 const double* p1,
const double* p2,
267 const double* p3,
const double* p4
296 const double* p0,
const double* p1,
297 const double* p2,
const double* p3,
const double* p4
319 const double* p0,
const double* p1,
320 const double* p2,
const double* p3,
341 const double* p0,
const double* p1,
const double* p2,
362 const double* p0,
const double* p1,
const double* p2,
391 const double* p0,
const double* p1,
const double* p2,
393 double h0,
double h1,
double h2,
double h3,
409 const double* p0,
const double* p1,
const double* p2
451 const double* p0,
const double* p1,
452 const double* p2,
const double* p3,
453 double h0,
double h1,
double h2,
double h3
469 const double* p0,
const double* p1,
470 const double* p2,
const double* p3
512 const double* p0,
const double* p1,
513 const double* p2,
const double* p3,
const double* p4,
514 double h0,
double h1,
double h2,
double h3,
double h4
538 const double* p0,
const double* p1,
539 const double* p2,
const double* p3,
const double* p4,
540 double h0,
double h1,
double h2,
double h3,
double h4
551 const double* p0,
const double* p1,
const double* p2
561 const double* p0,
const double* p1,
562 const double* p2,
const double* p3
574 const double* p0,
const double* p1,
575 const double* p2,
const double* p3,
588 const double* p0,
const double* p1,
const double* p2
599 const double* p0,
const double* p1,
const double* p2
638 const double* v0,
const double* v1,
const double* v2
696 const double* p0,
const double* p1,
697 const double* p2,
const double* p3
699 double a11 = p1[0] - p0[0] ;
700 double a12 = p1[1] - p0[1] ;
701 double a13 = p1[2] - p0[2] ;
703 double a21 = p2[0] - p0[0] ;
704 double a22 = p2[1] - p0[1] ;
705 double a23 = p2[2] - p0[2] ;
707 double a31 = p3[0] - p0[0] ;
708 double a32 = p3[1] - p0[1] ;
709 double a33 = p3[2] - p0[2] ;
Common include file, providing basic definitions. Should be included before anything else by all head...
T * data()
Gets modifiable vector data.
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.
bool aligned_3d(const double *p0, const double *p1, const double *p2)
Tests whether three points are aligned.
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_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 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 orient_2dlifted_SOS(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2, const vec2HE &p3, double h0, double h1, double h2, double h3)
Computes the 3d orientation test with lifted 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.
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.