Added pretty print and used the Bound nested type in the Algebraic kernel to define a non-integer bound of an interval

This commit is contained in:
Efi Fogel 2011-06-05 14:05:57 +00:00
parent 1c08f70313
commit 0a8d8e0712
1 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,8 @@ typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
int main ()
{
CGAL::set_pretty_mode(std::cout); // for nice printouts.
// create a polynomial representing x .-)
Polynomial_1 x = CGAL::shift(Polynomial_1(1),1);
@ -32,8 +34,9 @@ int main ()
// Create an arc supported by the polynomial y = x^4 - 6x^2 + 8,
// defined over the interval [-2.1, 2.1]:
Polynomial_1 P1 = x*x*x*x - 6*x*x + 8;
arcs.push_back( construct_arc(P1.begin(), P1.end(),
Alg_real_1(-2.1), Alg_real_1(2.1)));
Alg_real_1 l(Traits_2::Algebraic_kernel_d_1::Bound(-2.1));
Alg_real_1 r(Traits_2::Algebraic_kernel_d_1::Bound(2.1));
arcs.push_back( construct_arc(P1.begin(), P1.end(), l, r));
// Create an arc supported by the function y = x / (1 + x^2),
// defined over the interval [-3, 3]: