40 #ifndef GEOGRAM_NUMERICS_EXACT_GEOMETRY
41 #define GEOGRAM_NUMERICS_EXACT_GEOMETRY
47 #include <geogram/numerics/interval_nt.h>
52 #ifdef GEOGRAM_WITH_GEOGRAMPLUS
53 #include <geogram/geogramplus/numerics/exact_geometry.h>
70 #ifdef GEOGRAM_WITH_GEOGRAMPLUS
71 #define GEOGRAM_USE_EXACT_NT
143 template <
class VEC3 = vec3>
145 typedef typename VEC3::value_type value_type;
147 value_type(p2.x) - value_type(p1.x),
148 value_type(p2.y) - value_type(p1.y),
149 value_type(p2.z) - value_type(p1.z)
160 template <
class VEC2>
164 typedef typename VEC2::value_type value_type;
166 value_type(p2.x) - value_type(p1.x),
167 value_type(p2.y) - value_type(p1.y)
179 template <
class VEC3>
184 make_vec3<VEC3>(p1,p2),
185 make_vec3<VEC3>(p1,p3)
274 double l0,
double l1,
double l2,
double l3
295 double l0,
double l1,
double l2,
double l3
418 #ifdef GEO_HAS_BIG_STACK
423 template<> expansion_nt GEOGRAM_API
det(
const vec2E& v1,
const vec2E& v2);
428 template<> expansion_nt GEOGRAM_API dot(
const vec2E& v1,
const vec2E& v2);
433 template<> expansion_nt GEOGRAM_API dot(
const vec3E& v1,
const vec3E& v2);
438 template<> vec2Hg<expansion_nt> GEOGRAM_API mix(
439 const rationalg<expansion_nt>& t,
440 const vecng<2,double>& p1,
const vecng<2,double>& p2
446 template<> vec3Hg<expansion_nt> GEOGRAM_API mix(
447 const rationalg<expansion_nt>& t,
448 const vecng<3,double>& p1,
const vecng<3,double>& p2
454 template <> GEOGRAM_API
vec3E triangle_normal<vec3E>(
468 #ifdef GEOGRAM_USE_EXACT_NT
Expansion_nt (expansion Number Type) is used to compute the sign of polynoms exactly.
rationalg (generic rational) is used to compute the sign of rational fractions exactly.
2d vector with homogeneous coordinates
3d vector with homogeneous coordinates
Exact predicates and constructs.
High-level interface to multi-precision arithmetics.
Common include file, providing basic definitions. Should be included before anything else by all head...
Geometric functions in 2d and 3d.
Sign orient_2d_projected(const vec3HE &p0, const vec3HE &p1, const vec3HE &p2, coord_index_t axis)
Computes the orientation predicate in 2d projected along an axis.
Sign orient_2d(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2)
Computes the orientation predicate in 2d.
Sign incircle_2d_SOS_with_lengths(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2, const vec2HE &p3, double l0, double l1, double l2, double l3)
Tests whether a point is in the circumscribed circle of three other points.
bool on_segment_3d(const vec3HE &p, const vec3HE &q1, const vec3HE &q2)
Tests whether a point is on a segment.
vec3 approximate(const vec3HE &p)
Gets a 3D floating-point approximation of a 3D point with exact coordinates.
coord_index_t triangle_normal_axis(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Gets the axis that is most normal to a triangle.
Sign dot_2d(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2)
Computes the sign of the dot product between two vectors defined by three points.
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.
Sign incircle_2d_SOS(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2, const vec2HE &p3)
Tests whether a point is in the circumscribed circle of three other points.
vec2Hg< scalar > vec2h
2d vector with exact homogeneous coordinates
rationalg< scalar > rational
rational with exact numerator and denominator
vec3Hg< scalar > vec3h
3d vector with exact homogeneous coordinates
Global Vorpaline namespace.
vecng< 3, interval_nt > vec3I
vec3 with coordinates as interval_nt
vec2Hg< expansion_nt > vec2HE
2D vector in homogeneous coordinates with coordinates as expansions
vecng< 2, expansion_nt > vec2E
vec2 with coordinates as expansions
T geo_sqr(T x)
Gets the square value of a value.
vec2Hg< interval_nt > vec2HI
2D vector in homogeneous coordinates with coordinates as intervals.
VEC3 make_vec3(const vec3 &p1, const vec3 &p2)
Creates a vector with coordinates of arbitrary type from two points with double coordinates.
vecng< 2, interval_nt > vec2I
vec2 with coordinates as interval_nt
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
vec3E make_vec3< vec3E >(const vec3 &p1, const vec3 &p2)
Specialization of make_vec3() for vec3E.
double det(const mat2 &M)
Computes the determinant of a 2x2 matrix.
vec3Hg< expansion_nt > vec3HE
3D vector in homogeneous coordinates with coordinates as expansions
vec2E make_vec2< vec2E >(const vec2 &p1, const vec2 &p2)
Specialization of make_vec2() for vec2E.
Sign
Integer constants that represent the sign of a value.
vec3Hg< interval_nt > vec3HI
3D vector in homogeneous coordinates with coordinates as intervals.
VEC2 make_vec2(const vec2 &p1, const vec2 &p2)
Creates a vector with coordinates of arbitrary type from two points with double coordinates.
geo_coord_index_t coord_index_t
The type for storing coordinate indices, and iterating on the coordinates of a point.
VEC3 triangle_normal(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Computes the normal to a triangle from its three vertices.
vecng< 3, expansion_nt > vec3E
vec3 with coordinates as expansions
Filtered exact predicates for restricted Voronoi diagrams.
Generic implementation of geometric vectors in homogeneous coordinates.