Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] point lying over a line problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] point lying over a line problem


Chronological Thread 
  • From: "Fernando Cacciola" <>
  • To: <>
  • Subject: Re: [cgal-discuss] point lying over a line problem
  • Date: Wed, 23 Jul 2008 13:05:41 -0300
  • Organization: Geometry Factory

Hi Alejandro,

the point is supposed to lie over the line within let's
say tol = 10e-14.

This is an arbitrary interpretation of what lying over a line means.
If this interpretation works in you particular case, you can implement it easily via the squared_distance() function, but have in mind that your sample point miught not actually lie on the line in spite of the number type used.
That is, you will get the wrong answer for using plain double, but you could also be just expecting the opposite answer because you asummed closed enough is the same as exactly on the line. CGAL predicates are strictly exact: they return the answer they would if you used an exact number type.

Why would I use an exact number type?

You wouldn't.
Please read the FAQ much more carefully, in particular de paragraph starting with:

"If your program does not involve the construction of new objects from the input data..."

CGAL uses a technique knows as "Floating-point filtering" which exploits the precision of 'double' as much as possible yet it guarrantees correct results even when that precision is detected as not being enough for a particular operation.

HTH

Fernando Cacciola
www.geometryfactory.com




Archive powered by MHonArc 2.6.16.

Top of Page