28# include <gsl/gsl_rng.h>
29# include <gsl/gsl_randist.h>
42 double min_x,
double max_x,
43 double min_y,
double max_y)
53 for (
int i = 0; i < n; ++i)
60 cout <<
"Generating point " << i <<
endl;
69 cout <<
"success" <<
endl;
73 cout <<
" crosses" <<
endl;
78 cout <<
"closing ..." <<
endl;
84 cout <<
"Finished polygon generation" <<
endl;
92 cout <<
" close crosses" <<
endl;
120 Point pt(400 + 700, 400 + 100);
123 if (
el.contains_to(pt))
124 cout <<
"El punto de prueba " << pt.
to_string()
125 <<
" está dentro de la elipse de centro "
126 <<
el.get_center().to_string() <<
endl
127 <<
"con a = " <<
el.get_hradius() <<
" y b = " <<
el.get_vradius()
130 cout <<
"Falló prueba de inclusión del punto " << pt.
to_string()
131 <<
" en elipse de centro "
132 <<
el.get_center().to_string() <<
endl
133 <<
"con a = " <<
el.get_hradius() <<
" y b = " <<
el.get_vradius()
165 el.compute_tangents(
ts1,
ts2, 3.25);
185 gnu::autosprintf(
"m0 = %.2f",
sg0.slope())));
190 gnu::autosprintf(
"m1 = %.2f",
sg1.slope())));
195 gnu::autosprintf(
"m2 = %.2f",
sg2.slope())));
200 gnu::autosprintf(
"m3 = %.2f",
sg3.slope())));
205 gnu::autosprintf(
"m4 = %.2f",
sg4.slope())));
329 ofstream
output1(
"test-1.eepic", ios::trunc);
335 ofstream
output2(
"test-2.eepic", ios::trunc);
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.
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.
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.
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.
Segment-drawing variants (types).
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)