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: Morteza Manavi <>
  • To:
  • Subject: Re: [cgal-discuss] Convert arrangement output point
  • Date: Sun, 16 Sep 2018 18:31:21 +0430
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:tJS1ExO9UpcG8Z3h/owl6mtUPXoX/o7sNwtQ0KIMzox0Lfr6rarrMEGX3/hxlliBBdydt6obzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxlKiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD+s7bpkSAXwhSgIOT428mHZhMJzgqxGvhyuuwdyzJTIbIyPLvdyYr/RcNEcSGFcXshRTStBAoakYoUICOoBJ/pYoJf8plQUsBCwAhOjBOX1xT9Wh3/9wKo30+EmEQHcwAwvAdMPv27IoNnpKaseTP25wbLHzTXGdfxW2DP95JLUfRAmpPGBRLR9etffx0koEgPKlFSQqYr9MjyJ2eQCqWyb4/BnVeK1hG4qrRx6rDu3xso0lIXFmoYYxkrH+Ch52oo5O8G0RU1hbdK5FJZduCeXPJZsTMw4WWFnoiM6x6UGuZGleCgKz4wqxxvFZPyGd4iE+xbjVOSMLTthinJpZbayihmo/Uivze38Uca00FJUoSZfjtbMsXUN2wTS6siBVPR94l+s1SiT2w3X8O1JIkA5mbDFJ5I9wbM8jIcfvEDMEyPunUX5lq6WdkEq+uiy7OTnZ63rppqbN49ulgHxLKUvldajDegkLwQCQnWX9P+z1L3m50L5QbFKgucqnanetZDWPd4bqbKhAw9JzoYj7A6yACup0NsCmXkLNU9KeBOcj4f1JlHOO+v4AOykg1WslTdr3+rJMqfgApXLNHjDka3ucaxz605Gm0IPyoVU6JtQT70AO/nuQVTZtdrCDxZ/PRbn7fzgDYBY0ZkCVHCGSoqQNqrMsBfc4+U1P+SebddN4W+kA/cg7v/qy3Q+nAlOLuGSwZILZSXgTbxdKEKDbC+024ZTISIxpgM7CdfSphiHWD9XaWy1WvtltD4+AYOiS4zEQ9L02eDT7GKABpRTI1t+JBWUC36xLteLXv4NbGSZJcozymVZB4jkcJco0FSVjCG/y7djKbCKqCgRtJam0NosouOKxE10+jtzAMCQlWqKSjMskw==

Thanks Efi,
Is it possible to define Kernel such that accept Sqrt_extension coordinates as input? 

On Sun, Sep 16, 2018 at 5:26 PM 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, 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