46 double min_x,
double max_x,
47 double min_y,
double max_y)
56 for (
int i = 0; i < n; ++i)
63 cout <<
"Generating point " << i << endl;
72 cout <<
"success" << endl;
76 cout <<
" crosses" << endl;
81 cout <<
"closing ..." << endl;
87 cout <<
"Finished polygon generation" << endl;
94 cout <<
" close crosses" << endl;
122 Point pt(400 + 700, 400 + 100);
126 cout <<
"El punto de prueba " << pt.
to_string()
127 <<
" está dentro de la elipse de centro "
132 cout <<
"Falló prueba de inclusión del punto " << pt.
to_string()
133 <<
" en elipse de centro "
187 gnu::autosprintf(
"m0 = %.2f", sg0.
slope())));
192 gnu::autosprintf(
"m1 = %.2f", sg1.
slope())));
197 gnu::autosprintf(
"m2 = %.2f", sg2.
slope())));
202 gnu::autosprintf(
"m3 = %.2f", sg3.
slope())));
207 gnu::autosprintf(
"m4 = %.2f", sg4.
slope())));
331 ofstream
output1(
"test-1.eepic", ios::trunc);
337 ofstream
output2(
"test-2.eepic", ios::trunc);
The random number generators of Aleph: the one that gives the numbers of the gsl_rng_mt19937 of GSL,...
const Geom_Number & get_vradius() const
Gets the vertical radius.
void compute_tangents(Segment &s1, Segment &s2, const Geom_Number &m) const
Computes the two tangent segments to this ellipse with a given slope.
const Point & get_center() const
Gets the center point of the ellipse.
bool contains_to(const Point &p) const
const Geom_Number & get_hradius() const
Gets the horizontal radius.
Segment intersection_with(const Segment &sg) const
Computes the intersection segment between a line segment and this ellipse.
A random number generator with the sequences of GSL's gsl_rng_mt19937.
static constexpr result_type max() noexcept
The greatest number of operator()(): 2^32 - 1.
double flat(const double a, const double b) noexcept
A real number of the uniform distribution on [a, b), as gsl_ran_flat(r, a, b).
Represents a point with rectangular coordinates in a 2D plane.
std::string to_string() const
Returns a string representation of the point as "(x,y)".
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
A regular polygon defined by center, side length, and vertex count.
Represents a line segment between two points.
double slope() const
Returns the slope of the segment.
Point intersection_with(const Segment &s) const
Computes the intersection point of the infinite lines defined by two segments.
Segment mid_perpendicular(const Geom_Number &dist) const
Returns the perpendicular chord of a given length passing through the midpoint.
const Point & get_tgt_point() const noexcept
Gets the target point of the segment.
const Point & get_src_point() const noexcept
Gets the source point of the segment.
Represents a text string positioned at a 2D point.
A non-degenerate triangle defined by three points.
2D canvas for generating EEPIC/LaTeX picture environments.
void zoom(const double &factor)
Scale the EEPIC plane in real points (zoom in/out).
void put_cartesian_axis()
Enable drawing Cartesian axes when calling draw().
void draw(std::ostream &output, const bool &squarize=true)
Emits a complete LaTeX picture environment containing the geometric objects.
EEPIC/LaTeX geometric drawing utilities.
void put_in_plane(Tikz_Plane &plane, const Geom &geom_obj)
Insert any supported geometry type in a Tikz_Plane.
bool tiny_keys
Global flag to enable tiny font size for keys/labels.
Polygon make_random_polygon(const size_t &n, double min_x, double max_x, double min_y, double max_y)