52#include <gtest/gtest.h>
70 return std::abs(a - b) <
tol;
137 std::string str = origin.to_string();
139 EXPECT_NE(str.find(
"0"), std::string::npos);
144 std::string str =
static_cast<std::string
>(p1);
180 Point right{0.5, -1};
191 Point right{0.5, -1};
309 std::string str = polar.to_string();
346 EXPECT_EQ(horizontal.get_src_point(), origin);
347 EXPECT_EQ(horizontal.get_tgt_point(), p1);
392 const Point &
l = s.lowest_point();
399 const Point &
l = s.leftmost_point();
524 std::string str = diagonal.to_string();
551 double angle = s.counterclockwise_angle();
624 const Point &
l = t.lowest_point();
630 const Point &
l = t.leftmost_point();
734 r_mod.set_rect(1, 2, 3, 4);
777 EXPECT_EQ(
e2.get_hradius(), ellipse.get_hradius());
778 EXPECT_EQ(
e2.get_vradius(), ellipse.get_vradius());
790 Point l = ellipse.lowest_point();
797 Point l = ellipse.leftmost_point();
928 std::string str =
"hello";
935 std::string str =
"\\alpha";
942 std::string str =
"$x$";
949 std::string str =
"{ab}";
1027 Segment s{src, slope, length};
1117 testing::InitGoogleTest(&
argc,
argv);
size_t size() const noexcept
Count the number of elements of the list.
static bool is_clockwise()
Rectangular point in the plane.
const Geom_Number & get_y() const
Returns y value.
const Point & highest_point() const
const Point & rightmost_point() const
const Geom_Number & get_x() const
Returns x value.
Polar representation of a 2D point.
Fundamental segment defined by two points.
bool vertical
If true, use vertical layout (default).
Main namespace for Aleph-w library functions.
bool diff(const C1 &c1, const C2 &c2, Eq e=Eq())
Check if two containers differ.
DynList< T > maps(const C &c, Op op)
Classic map operation.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
2D point and geometric utilities.
mpq_class Geom_Number
Numeric type used by the geometry module.
Geom_Number pitag(const Geom_Number &x, const Geom_Number &y)
Return the Euclidean distance.
Geom_Number arctan2(const Geom_Number &m, const Geom_Number &n)
Two-argument arc tangent (wrapper over mpfr).
double geom_number_to_double(const Geom_Number &n)
Geom_Number arctan(const Geom_Number &m)
Arc tangent of m (wrapper over mpfr).
Geom_Number square_root(const Geom_Number &x)
Square root of x (wrapper over mpfr).
Geom_Number cosinus(const Geom_Number &x)
Cosine of x (wrapper over mpfr).
Geom_Number sinus(const Geom_Number &x)
Sine of x (wrapper over mpfr).
size_t aproximate_string_size(const std::string &str)
Geom_Number area_of_parallelogram(const Point &a, const Point &b, const Point &c)
Compute the area of parallelogram defined by vectors a->b and b->c.
TEST_F(PointTest, DefaultConstruction)
bool approx_equal(const Geom_Number &a, const Geom_Number &b, double tol=EPSILON)
const bool between(const Point &a, const Point &b, const Point &c)
Test if point c is between points a and b.