Subject: CGAL users discussion list
List archive
- From: llduncan <>
- To: cgal-discuss <>, cgal-discuss <>
- Subject: [cgal-discuss] calculating intersection point of plane and line
- Date: Fri, 27 Sep 2013 21:49:34 +0800
plane: nX=d
line: mt+p0
(mt+p0)*n=d
m*nt+p0*n=d
t=(d-p0*n)/(m*n)
if(t!=infinity)
there is a intersection point: m*t+p0
else
there is no intersection point or have infinity intersection
point(平行或重叠)
llduncan
From: Martin
Uhrin
Date: 2013-09-27 19:40
To: cgal-discuss
Subject: [cgal-discuss] NaN calculating intersection point of
plane and line
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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] NaN calculating intersection point of plane and line, Martin Uhrin, 09/27/2013
- Re: [cgal-discuss] NaN calculating intersection point of plane and line, Sebastien Loriot (GeometryFactory), 09/27/2013
- Re: [cgal-discuss] NaN calculating intersection point of plane and line, Martin Uhrin, 09/27/2013
- Re: [cgal-discuss] NaN calculating intersection point of plane and line, Sebastien Loriot (GeometryFactory), 09/27/2013
- Re: [cgal-discuss] NaN calculating intersection point of plane and line, Martin Uhrin, 09/27/2013
- [cgal-discuss] calculating intersection point of plane and line, llduncan, 09/27/2013
- Re: [cgal-discuss] NaN calculating intersection point of plane and line, Sebastien Loriot (GeometryFactory), 09/27/2013
Archive powered by MHonArc 2.6.18.