Subject: CGAL users discussion list
List archive
- From: Alejandro M. Aragón <>
- To:
- Subject: [cgal-discuss] point should lie on the line but it doesn't, please help
- Date: Sun, 20 Jul 2008 23:35:05 +0200 (CEST)
Hello everyone,
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.
Alejandro M. Aragón
- [cgal-discuss] point should lie on the line but it doesn't, please help, Alejandro M . Aragón, 07/20/2008
Archive powered by MHonArc 2.6.16.