2026-07-23 05:27:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
#include "vde/foundation/math_types.h"
|
|
|
|
|
|
|
|
|
|
namespace vde::foundation::exact {
|
|
|
|
|
|
|
|
|
|
enum class Orientation { Clockwise, CounterClockwise, Collinear };
|
|
|
|
|
enum class CircleTest { Inside, On, Outside };
|
|
|
|
|
|
|
|
|
|
/// Adaptive-precision 2D orientation test (Shewchuk)
|
|
|
|
|
Orientation orient_2d(const Point2D& a, const Point2D& b, const Point2D& c);
|
|
|
|
|
|
|
|
|
|
/// Adaptive-precision 3D orientation test
|
|
|
|
|
Orientation orient_3d(const Point3D& a, const Point3D& b,
|
|
|
|
|
const Point3D& c, const Point3D& d);
|
|
|
|
|
|
|
|
|
|
/// Adaptive-precision in-circle test
|
|
|
|
|
CircleTest in_circle(const Point2D& a, const Point2D& b,
|
|
|
|
|
const Point2D& c, const Point2D& d);
|
|
|
|
|
|
|
|
|
|
} // namespace vde::foundation::exact
|
2026-07-23 10:32:51 +00:00
|
|
|
|
|
|
|
|
/// Adaptive double-precision predicates (default backend)
|
|
|
|
|
namespace vde::foundation {
|
|
|
|
|
struct AdaptiveDouble {
|
|
|
|
|
static exact::Orientation orient_2d(const Point2D& a, const Point2D& b, const Point2D& c) {
|
|
|
|
|
return exact::orient_2d(a, b, c);
|
|
|
|
|
}
|
|
|
|
|
static exact::Orientation orient_3d(const Point3D& a, const Point3D& b,
|
|
|
|
|
const Point3D& c, const Point3D& d) {
|
|
|
|
|
return exact::orient_3d(a, b, c, d);
|
|
|
|
|
}
|
|
|
|
|
static exact::CircleTest in_circle(const Point2D& a, const Point2D& b,
|
|
|
|
|
const Point2D& c, const Point2D& d) {
|
|
|
|
|
return exact::in_circle(a, b, c, d);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
} // namespace vde::foundation
|