68 std::uniform_real_distribution<double> unif(-10000,10000);
69 std::default_random_engine re;
73 const RealPoint center(unif(re),unif(re));
74 Shape shape( center, unif(re), unif(re) );
78 SECTION(
"Lower and upper bounds")
80 Shape shape( unif(re), unif(re), unif(re), unif(re) );
84 SECTION(
"parameter() with null x-radius -> division by 0.")
90 SECTION(
"parameter() with null y-radius -> division by 0.")
96 SECTION(
"parameter() with null x-radius and y-radius -> undefined behaviour.")
98 Shape shape( unif(re), unif(re), 0., 0. );
102 SECTION(
"parameter() where (x,y) parameter with x == center -> pi/2 or 3*pi/2")
104 const double centerX = unif(re);
105 Shape shape( centerX, unif(re), unif(re), unif(re) );
106 const RealPoint point( centerX, unif(re) );
107 REQUIRE_NOTHROW( shape.
parameter(point) );
109 REQUIRE_THAT( res, Catch::WithinAbs(M_PI_2,DBL_EPSILON) || Catch::WithinAbs(3*M_PI_2,DBL_EPSILON) );
112 SECTION(
"parameter() with point parameter with null y -> 0. or pi")
114 const double centerY = unif(re);
115 Shape shape( unif(re), centerY, unif(re), unif(re) );
116 const RealPoint point( unif(re), centerY );
117 REQUIRE_NOTHROW( shape.
parameter(point) );
119 REQUIRE_THAT( res, Catch::WithinAbs(0.,DBL_EPSILON) || Catch::WithinAbs(M_PI,DBL_EPSILON) );