Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon
Chronological Thread
- From: axnmol <>
- To:
- Subject: Re: [cgal-discuss] 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon
- Date: Mon, 27 Apr 2020 05:01:43 -0500 (CDT)
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
- Ironport-phdr: 9a23:VXFX4x8yGbCHvP9uRHKM819IXTAuvvDOBiVQ1KB52ugcTK2v8tzYMVDF4r011RmVBNidtqMP0bKempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffgVFiCC9bL52Ixm6sxndvdQKjIV/Lao81gHHqWZSdeRMwmNoK1OTnxLi6cq14ZVu7Sdete8/+sBZSan1cLg2QrJeDDQ9LmA6/9brugXZTQuO/XQTTGMbmQdVDgff7RH6WpDxsjbmtud4xSKXM9H6QawyVD+/6apgVR3mhzodNzMh/m/ZitJ+gqFZrxKvuhJwzJLbbo6OOfpifK7RYc8WSXZdUspPUSFKH4Oyb5EID+oEJetXtYb8p10LrRu5AQmnGeTixSVHh3/wwKI6z/khHBrJ3AwlBd0OsXDUoM/pO6cVVOC41a/FxijNYfNR3Dfy8onIchY5rPGKR71/atHeyU0xGA/fklqQronlMjWI3eoOq2iW9/dsWOarhmI9pQx8oSKjy8Qth4XTh48Yy1bJ/jhjzokvP923Ukt7bMakEJROsyGaMJN7QsUtTm1yviY10KYJtoW/fCcU0pgo2xnfa/mff4iJ5BLsSvqRLC9liH9hfL+znRi//Eu6xuD/V8S4yldHoytdntnJrH8N1hjT6sadSvt6+0eswSyA1g/V6u5ZPUA0iLHWK5EkwrEql5oTtV7PETPxmEXzlKOWbFkr+vC06+T7ZbXrvoOTN4BuhQH6K6ghh82/Af8kPQgTRGib4v+x1Kbj/E38WLVFlOc6kqjfsJDAJMQUvLS1AwFP0tVr1xHqBDiv1JEUnGIMMUleUBOBlYngfV/Uc97iCvLqikSqlTBvj6TPLrvtHojlIX3KkbOndrF4vR0PgDEvxMxSssoHQooKJ+j+Dxeo5Y7oSyQhOgnx+N7JTdB014cQQ2WKW/bLP6bbsFvO7eUqcbLVON0l/Q3lIv1g3MbAyGcjkAZEL6as1JoTLnu/G6Y+ehjLUT/Xmt4EVFwykE8+Qejt0QDQV2IVYX+4VaYxoDo8DdD/AA==
Hey Luoyo,
I think the function you are looking for is CGAL::Segment_2::has_on(), It
states exactly whether the point lies on the segment or not. The function
CGAL::Segment_2::collinear_has_on() is more like if the points lie in the
rectangular region of which segment is the diagonal of hence considerably
faster.
So try this instead:
void testPointCollinear()
{
Point_2 startPoint(220.240005, -121.932671);
Point_2 endPoint(-369.040009, -439.420013);
Point_2 checkPoint(-49.0955925, -267.043030);
CGAL::Segment_2<Kernel> testSegment(startPoint, endPoint);
if (testSegment.has_on(checkPoint)) {
std::cout << "points collinear" << std::endl;
}
else {
std::cout << "points not collinear" << std::endl;
}
}
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- Re: [cgal-discuss] difference for 2d polygons return incorrect polygon, (continued)
- Re: [cgal-discuss] difference for 2d polygons return incorrect polygon, Efi Fogel, 04/26/2020
- [cgal-discuss] 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/26/2020
- Re: [cgal-discuss] 回复: difference for 2d polygons return incorrect polygon, Efi Fogel, 04/26/2020
- [cgal-discuss] 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/26/2020
- [cgal-discuss] 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- [cgal-discuss] 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- [cgal-discuss] 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- [cgal-discuss] 回复: 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- [cgal-discuss] 回复: 回复: 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: 回复: 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- [cgal-discuss] 回复: 回复: 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/27/2020
- Re: [cgal-discuss] 回复: 回复: difference for 2d polygons return incorrect polygon, axnmol, 04/27/2020
- Re: [cgal-discuss] 回复: difference for 2d polygons return incorrect polygon, Efi Fogel, 04/26/2020
- [cgal-discuss] 回复: difference for 2d polygons return incorrect polygon, 落 域, 04/26/2020
- Re: [cgal-discuss] difference for 2d polygons return incorrect polygon, Efi Fogel, 04/26/2020
Archive powered by MHonArc 2.6.18.