41#include <gtest/gtest.h>
49 Point a(0, 0), b(1, 0), c(0, 1);
55 Point a(0, 0), b(0, 1), c(1, 0);
61 Point a(0, 0), b(1, 1), c(2, 2);
67 Point a(3, 5), b(3, 5), c(7, 2);
75 Point a(0, 0), b(4, 0), c(0, 4);
82 Point a(0, 0), b(0, 4), c(4, 0);
89 Point a(0, 0), b(4, 0), c(0, 4);
96 scene.points.append(a);
97 scene.points.append(b);
98 scene.points.append(c);
99 scene.highlighted_points.append(p);
101 "case_incircle_on_circle",
scene,
102 "in_circle() / point on circumcircle");
109 Point a(0, 0), b(4, 0), c(0, 4);
116 Point a(0, 0), b(1, 1), c(2, 2);
123 Point a(0, 0), b(4, 0), c(0, 4);
195 "case_segments_collinear_overlap",
scene,
196 "segments_intersect() / collinear overlap");
268 scene.highlighted_points.append(p);
270 "case_intersection_exact_rational_non_trivial",
scene,
271 "segment_intersection_point() exact rational");
327 scene.highlighted_points.append(p);
329 "case_intersection_collinear_touch_endpoint",
scene,
330 "segment_intersection_point() / endpoint touching");
396 Point a(0, 0), b(3, 0), c(0, 4);
402 Point a(0, 0), b(1, 1), c(2, 2);
409 Point a(0, 0), b(1, 0), c(0, 1);
T & append(const T &data)
Append a copy of data
Represents a point with rectangular coordinates in a 2D plane.
const Geom_Number & get_x() const noexcept
Gets the x-coordinate value.
const Geom_Number & get_y() const noexcept
Gets the y-coordinate value.
Represents a line segment between two points.
bool vertical
If true, use vertical layout (default).
std::filesystem::path emit_case_svg(const std::string &case_id, const SvgScene &scene, const std::string ¬e="")
Orientation
Classification of three-point orientation.
Geom_Number in_circle_determinant(const Point &a, const Point &b, const Point &c, const Point &p)
Return the exact in-circle determinant for (a,b,c,p).
bool on_segment(const Segment &s, const Point &p)
Return true if p lies on segment s (exact).
bool segments_intersect(const Segment &s1, const Segment &s2)
Return true if segments s1 and s2 intersect (including endpoints).
InCircleResult in_circle(const Point &a, const Point &b, const Point &c, const Point &p)
Classify point p against circumcircle of triangle (a,b,c), exactly.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Point segment_intersection_point(const Segment &s1, const Segment &s2)
Compute the exact intersection point of segments s1 and s2.
Geom_Number area_of_triangle(const Point &a, const Point &b, const Point &c)
Return the (unsigned) area of triangle (a, b, c) as an exact rational.
Orientation orientation(const Point &a, const Point &b, const Point &c)
Return the orientation of the triple (a, b, c).
mpq_class Geom_Number
Numeric type used by the geometry module.
2D point and geometric utilities.
::Array<::Segment > segments