Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Ask:is there a bug in the intersection function

Subject: CGAL users discussion list

List archive

[cgal-discuss] Ask:is there a bug in the intersection function


Chronological Thread 
  • From: "梓桥" <>
  • To: "cgal-discuss" <>
  • Subject: [cgal-discuss] Ask:is there a bug in the intersection function
  • Date: Fri, 12 Mar 2010 16:29:37 +0800

Hello!
Every one,is there a bug in the intersection function? why the following code result in "no intersection"? actually the two line intersects.

best regards!

   
CGAL::Point_2<Kernel> point;
    CGAL::Segment_2<Kernel> seg;
    Segment_2 iseg(Point_2(106.38,90.94),Point_2(106.38,91.12));
    K::Vector_2 v=K::Vector_2(Point_2(69.72,82.12),Point_2(150.26,117.86));
    Ray_2 parelleline(Point_2(86.4848,82.12),v);

    CGAL::Object o=intersection (iseg, parelleline);
    if (CGAL::assign(seg, o)){
        std::cout<<"the intersection is a segment";                            
    }else if(CGAL::assign(point, o))    {
        std::cout<<"the intersection is a point: "<<point.x()<<" "<<point.y();
    }else
    {
        std::cout<<"no intersection";
    }


Archive powered by MHonArc 2.6.16.

Top of Page