Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Convert arrangement output point

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Convert arrangement output point


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] Convert arrangement output point
  • Date: Sun, 16 Sep 2018 15:55:47 +0300
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:C6JW4BIfswY8py9/ctmcpTZWNBhigK39O0sv0rFitYgRKPrxwZ3uMQTl6Ol3ixeRBMOHs60C07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwdFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhygJNzE78G/ZhM9+gr9Frh29vBFw2ZLYbZuPOfZiYq/Qf9UXTndBUMZLUCxBB5uxYYQBD+oAIO1Wr479p1QQohu6GAKhA/3gyjFJhn/42q063PouEQXd0QwvGtIBqnXUrNHvOKgOVuC1ybDFwDPeZP1Y3jf97ZLHchEnofyUQb1wftDeyU01GwPClFWQporoNC6W2OQVq2WX8fZsWOa1h2Mkqwx9uCajytosh4XTm44YyFLJ+CNky4gvP9K4UlR0Ydu8HZtQqS6aM4x2T9snQ25yuSY6zqQKuYa0fCQX0ZgnyQPTZv6FfoSS7RLjU+GRITh8hH17Yr6wmxGy8U24xu39UMm7zkpKozJbntXQsn0BzR/e58idRvdj40us2SyD2x3R5+xGOUw0kLDUK58lwr4+jJoTtkHDEzfol0X4ja+WeEIk+ue25OTjebjmqZqcOJV1igH6KKghhsu/AeEgPggUQ2eb4fi81KHk/UDhXLpKgec5kq3AvJ/HJMQbvbK2AxJO0oY48Bu/FDen0NEAnXYdNl5FeRSHj5LoO17UOvz4A+2/0ByQl2JgyPnCe7HgGZ7QNWPrkbH7fL875VQP5hA0yIVy6ZMcJLYOLfa7DkL/tdLfARI9GwOxyufjTt5609VNCiq0HqaFPfaK4hez7eU1LrzUPd5HiHPGM/EgosXWozo8kF4Zc7Ou2MJOOn+9F/ViZU6eZCi124tTISIxpgM7CdfSphiaSzcKPiS9Wqs94ncwD4f0Vd6eFLDou6SI2WKAJrMTZm1CDQrSQ3LhdoHBQ/hVLSzLfZAnnTsDWrysDYQm0EP2uQ==

If you absolutely need to use a vertex position as a circle center, you cannot use Arr_circle_segment_traits_2.
In this case you need to resort to a more "powerful" traits, such as the Arr_algebraic_segment_traits_2 traits.

Sqrt_extension
cannot be converted to Rational without loss of data.

Naturally, managing, for example, segments, by the Arr_algebraic_segment_traits_2 is more time-consuming then by the Arr_circle_segment_traits_2.
So, make sure that the above is a must. (That is, circle centers may need to have Sqrt_extension coordinates.)
For example, consider a point p = (x,y) with Sqrt_extension coordinates that lies on some circle C.
You can approximating p with p' = (x', y'), such that p' also lies on C while bounding the difference between p and p'; see, e.g.,  CGAL::rational_rotation_approximation().

   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sun, 16 Sep 2018 at 15:48, Efi Fogel <> wrote:
If you absolutely need to use a vertex position as a circle center, you cannot use Arr_circle_segment_traits_2.
In this case you need to resort to a more "powerful" traits, such as the Arr_algebraic_segment_traits_2 traits.

Sqrt_extension
cannot be converted to Rational without loss of data.

Naturally, managing, e.g., segments, by the Arr_algebraic_segment_traits_2 is less efficient then by the Arr_circle_segment_traits_2.
So, make sure that the above is a must. For example
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sun, 16 Sep 2018 at 13:36, Morteza Manavi <> wrote:
Hi,
I define arrangement:
typedef CGAL::Cartesian<CGAL::Exact_rational>                   Kernel;
typedef Kernel::Circle_2                                        Circle_2;

typedef CGAL::Arr_circle_segment_traits_2<Kernel>               Traits_2;
typedef CGAL::Arrangement_with_history_2<Traits_2>              Arr_with_hist_2;

and I want to get a vertex position and use it for creation new circle in the arrangement but I should use a Point with rational type as circle position while the type of vertex position is 
Sqrt_extension and CGAL do not convert Sqrt_extension to Rational. Now I do not know how to convert Sqrt_extension to Rational such that do not loss data.(convert exactly)

 



Archive powered by MHonArc 2.6.18.

Top of Page