Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Dual edge of Apollonius Graph

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Dual edge of Apollonius Graph


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Dual edge of Apollonius Graph
  • Date: Thu, 19 Feb 2015 09:30:00 +0100
  • Organization: GeometryFactory

The code responsible for providing the approximation points is in:
include/CGAL/Hyperbola_2.h

line 266 : void generate_points

At least 100 points should be generated per hyperbola.

Try switching to Exact_predicates_inexact_constructions_kernel as Kernel.
If this still does not work try printing the points in the
aforementioned function to check that you don't have a bug in
your drawing code.

About the error with MP_FLoat, you should have used CGAL::Quotient<CGAL::MP_Float> (which is not recommended if you
have gmp on your machine as CGAL::Gmpq is a better alternative
for non-filtered rational computations).

Sebastien.

On 02/18/2015 05:32 AM, Narusaki wrote:
Hi everyone,

I'm totally new to CGAL and recently I want to use the Apollonius Graph in
the library to construct the weighted Voronoi diagram under CGAL 4.5 and
Microsoft Visual Studio 2010. For the rendering purpose I define a stream
class whose main part is the operator<< with Segment_2 as parameter, and I
use it as the parameter of the draw_dual_edge() method of the
Apollonius_graph_2 class. However, I found the weird thing as follow:

If I use the following two sites (in the format of (x, y, w) where x and y
are coordinates and w is weight):
(0.80410481369434716 0.89234204587973531 0)
(0.064896832669279911 -0.51119635852810019 -0.72435163677780512)

in which case the diagram should be a hyperbola, it shows like three rays as
follow:
<http://cgal-discuss.949826.n4.nabble.com/file/n4660456/p3.png>

if I multiple each x, y and w by 10^4, it shows as follow, with a reasonable
hyperbola and an extra ray:
<http://cgal-discuss.949826.n4.nabble.com/file/n4660456/p1.png>

Now I have two questions:

1. I don't know too much about this but I guess it's sth about the accuracy.
Here I'm just using the double type as follow:

typedef double NT;
typedef CGAL::Simple_cartesian<NT> K;

I try to use the MP_float type, the draw_dual_edge() method of
Apollonius_graph_2 seems to have some compiling error with the division(/)
operator as follow:

error C2676: binary '/' : 'CGAL::MP_Float' does not define this operator or
a conversion to a type acceptable to the predefined operator

So is it an accuracy issue and what should I do about it?

2. Why there is an extra ray starting from the center of this branch of
hyperbola?



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Dual-edge-of-Apollonius-Graph-tp4660456.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.18.

Top of Page