17 double range_center = 1000;
22 nb_runs = std::atoi( argv[1] );
24 std::srand( std::time(
nullptr) );
25 Point2d dummy_pt( range_center * std::rand() / RAND_MAX, range_center * std::rand() / RAND_MAX );
27 std::cout <<
"-Running with n=" << nb_runs
28 <<
"\n-HOMOG2D_OPTIMIZE_SPEED: " 29 #ifdef HOMOG2D_OPTIMIZE_SPEED 34 <<
"\n-HOMOG2D_NOCHECKS: " 35 #ifdef HOMOG2D_NOCHECKS 40 <<
"\n Ellipse memory footprint=" <<
sizeof(
Ellipse ) <<
'\n';
42 for(
size_t i=0; i<nb_runs; i++ )
44 auto x0 = range_center * std::rand() / RAND_MAX;
45 auto y0 = range_center * std::rand() / RAND_MAX;
46 auto a = esize * std::rand() / RAND_MAX + 1.;
47 auto b = esize * std::rand() / RAND_MAX + 1.;
48 auto angle = 2.0 *
M_PI * std::rand() / RAND_MAX;
51 if( dummy_pt.isInside(
ell ) )
58 if( dummy_pt.distTo(
center) < range_center )
62 std::cout <<
"Result: c1=" << c1 <<
" c2=" << c2 <<
" c3=" << c3 <<
'\n';
Point2d_< FPT > & center(Circle_< FPT > &cir)
Returns reference on center of circle (free function), non-const version.
Definition: homog2d.hpp:10934
Point2d_< FPT > getCenter() const
Returns center of ellipse.
Definition: homog2d.hpp:8581
Ellipse_< HOMOG2D_INUMTYPE > Ellipse
Default ellipse type.
Definition: homog2d.hpp:12402
#define M_PI
Definition: homog2d.hpp:235
CPolyline_< FPT > getOBB() const
Returns oriented bounding box of ellipse as a closed Polyline.
Definition: homog2d.hpp:8680
Ellipse as a conic in matrix form.
Definition: homog2d.hpp:380
HOMOG2D_INUMTYPE angle(const Ellipse_< FPT > &ell)
Return angle of ellipse (free function)
Definition: homog2d.hpp:10993
Ellipse ell
Definition: homog2d_test.cpp:4037
Base class, will be instanciated as Point2d_ or Line2d_.
Definition: homog2d.hpp:365