Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Problem with point collinearity

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Problem with point collinearity


Chronological Thread 
  • From: Sylvain Pion <>
  • To:
  • Subject: Re: [cgal-discuss] Problem with point collinearity
  • Date: Fri, 15 Jun 2007 07:32:06 +0200


a écrit :
Hi all,

This should be a very easy question.

When I check if the points (0.14, 0.22), (0.15, 0.21) and (0.19,0.17) are
collinear, using CGAL::collinear, it returns “CGAL_LEFT”, which is false,
because those points are in fact collinear.

They are not collinear. 0.14 in C++ is of type double.
It is only an approximation of the real value 0.14.

There is no reasonable way CGAL can fix this up afterwards.
If you really want the value 0.14, you need to use a rational
number type, and use for example T(14)/T(100).

--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page