Improve contour FindPointInPolygon() reliability (3).

This commit is contained in:
wo80
2022-02-28 11:47:26 +01:00
parent 227e9d9c66
commit e8ca95960f
2 changed files with 22 additions and 0 deletions
+3
View File
@@ -36,6 +36,9 @@ namespace TriangleNet.Tools
// Length of the segment.
double ab = (b.X - a.X) * (b.X - a.X) + (b.Y - a.Y) * (b.Y - a.Y);
// Ignore duplicate input points.
if (ab == 0) return false;
// Check if test point is actually between a and b (right of b).
if (dot > ab) return false;