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: Alejandro Aragon <>
  • To:
  • Subject: Re: [cgal-discuss] point lying over a line problem
  • Date: Wed, 23 Jul 2008 10:50:49 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=ivSlJ13lbC8RzuQoWMQnVIKc474vxtQmcXiV/NgtObN8T1rpIkD2CVcZXlzWd/BRLd cOcL0s6DzuwLjIVD8KYGmkLEBxzRbnVyFdJBC5jmRpw348/f9rhBaQN/gaHSGCyFgPmP e6Pgn0o6qjhFIISeO2LKH+WXOtV1hNTr9nxMU=

There is nothing in the FAQ that prevents people from reposting a message, thanks for your helpful reply.

On Jul 23, 2008, at 10:38 AM, Sylvain Pion wrote:

Alejandro Aragon a écrit :
Hi, no one has replied to my post yet, so I decided to send it again in case someone will.

Wrong decision : you should have decided to read the FAQ, for example.


I'm trying to check how the oriented_side() function works for a line. I
created a very simple example, where a point should lie on a line, but it
doesn't. The program is as follows:
#include <CGAL/Cartesian.h>
#include <iostream>
using std::cout;
using std::endl;
int main() {
typedef CGAL::Cartesian<double> KernelType;
typedef KernelType::Point_2 PointType;
typedef KernelType::Line_2 LineType;
PointType p(0.034,0.006);
cout<<"point -> "<<p<<endl;
LineType l(-0.004, 0.004, 0.000112);
cout<<"line -> "<<l<<endl;
CGAL::Oriented_side test = l.oriented_side(p);
if ( test == CGAL::ON_POSITIVE_SIDE ) {
cout<<"point on positive side"<<endl;
} else if ( test == CGAL::ON_NEGATIVE_SIDE ) {
cout<<"point on negative side"<<endl;
} else {
cout<<"point over line"<<endl;
}
return 0;
}
The output of this little program is:
point -> 0.034 0.006
line -> -0.004 0.004 0.000112
point on negative side
Can someone tell me what is happening here? The point should not be on the
negative side. Thank you all.


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





Archive powered by MHonArc 2.6.16.

Top of Page