Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
point_utils_header_test.cc
Go to the documentation of this file.
1#include <point_utils.H>
2
3#include <gtest/gtest.h>
4
5TEST(PointUtilsHeaderTest, IsSelfContained)
6{
7 const Aleph::Point a(0, 0);
8 const Aleph::Point b(1, 0);
9 const Aleph::Point c(0, 1);
10
11 // Checked as a bool: EXPECT_GT would print the Geom_Number (mpq_class)
12 // on failure through the compiled operator<< of libgmpxx, which does not
13 // link on Windows. The message prints it as a double instead.
14 const Aleph::Geom_Number area = Aleph::area_of_triangle(a, b, c);
15 EXPECT_TRUE(area > 0) << "area = " << area.get_d();
17}
Represents a point with rectangular coordinates in a 2D plane.
Definition point.H:221
#define TEST(name)
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.
Definition point.H:3037
Orientation orientation(const Point &a, const Point &b, const Point &c)
Return the orientation of the triple (a, b, c).
Definition point.H:2902
Legacy geometric utilities — use point.H functions directly.