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: Bernd Gaertner <>
  • To:
  • Subject: Re: [cgal-discuss] Problem with point collinearity
  • Date: Fri, 15 Jun 2007 16:11:58 +0200


wrote:
I can do:

Point1 P1(2,3);
Point2 P2(CGAL::to_double(P1.x()),CGAL::to_double(P1.y()));

But I think that this is not very efficient.

And it's not safe, since to_double is not exact on Quotient<double>.
You could either use simply double as NT (since it's a field number
type, there is no need to put a quotient on top), in which case the
above is safe (and works even without the to_double's). Or, if you
insist on NT = GAL::Quotient<double> for some reason, you could use

P2 ( CGAL::Gmpq(P1.x().numerator()) / CGAL::Gmpq(P1.x().denominator()),
CGAL::Gmpq(P1.y().numerator()) / CGAL::Gmpq(P1.y().denominator()) )

Bernd.



Archive powered by MHonArc 2.6.16.

Top of Page