Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] NaN calculating intersection point of plane and line

Subject: CGAL users discussion list

List archive

[cgal-discuss] NaN calculating intersection point of plane and line


Chronological Thread 
  • From: Martin Uhrin <>
  • To:
  • Subject: [cgal-discuss] NaN calculating intersection point of plane and line
  • Date: Fri, 27 Sep 2013 12:40:14 +0100

Dear CGAL community,

I'm having problems calculating the intercept of a plane and a line.
To give one example, the result of an intersection gives me a points
that streams out as:

4 5.38925e+2284/9.43119e+2284 0/9.43119e+2284 0/9.43119e+2284 0/1.23183e+2285

This is indeed the answer I expect (0.57.. 0 0 0) but represented in
this format I can't get a sensible double out (using to_double),
presumably as it's converting the numerator and denominator to doubles
and then expects to be able to do the division.

Background:

I'm generating a convex hull with using:

typedef CORE::Expr NT;
typedef CGAL::Quotient< NT> RT;
typedef CGAL::Cartesian_d<RT> Kernel;
typedef CGAL::Convex_hull_d< Kernel> Hull;

I need a number type that supports quotients and general square roots
and this was the only way (other than using using LEDA which I'd
rather avoid) that I could think of.

To get the intercept I use:

Kernel::Intersect_d intersect = Kernel().intersect_d_object();
... = intersect(line, hyperplane);

where hyperplane is supporting a facet of my hull.

Any ideas on how I can get a sensible double out would be much appreciated.

Kind regards,
-Martin

--
Martin Uhrin Tel: +44
207 679 3466
Department of Physics & Astronomy Fax:+44 207 679 0595
University College London

Gower St, London, WC1E 6BT, U.K. http://www.cmmp.ucl.ac.uk



Archive powered by MHonArc 2.6.18.

Top of Page