我认为您试图定义包含无限远点的几何数学的完整内容,这会使您的生活变得更加困难。对于您最初的问题,即准确计算Delaunay三角剖分,这是不必要的。
我之前用Java编写了一个Delaunay生成器,可以在这里找到:
http://open.trickl.com/trickl-graph/index.html
请参见http://open.trickl.com/trickl-graph/apidocs/index.html ,特别是:
private boolean isWithinCircumcircle(PlanarGraph<V, E> graph, V first,
V second,
V third,
V fourth) {
Coordinate p = vertexToCoordinate.get(fourth);
if (PlanarGraphs.isVertexBoundary(graph, first)) {
return isLeftOf(third, second, p);
} else if (PlanarGraphs.isVertexBoundary(graph, second)) {
return isLeftOf(first, third, p);
} else if (PlanarGraphs.isVertexBoundary(graph, third)) {
return isLeftOf(second, first, p);
} else if (PlanarGraphs.isVertexBoundary(graph, fourth)) {
return false;
}
Coordinate a = vertexToCoordinate.get(first);
Coordinate b = vertexToCoordinate.get(second);
Coordinate c = vertexToCoordinate.get(third);
boolean within = (a.x * a.x + a.y * a.y) * getDblOrientedTriangleArea(b, c, p)
- (b.x * b.x + b.y * b.y) * getDblOrientedTriangleArea(a, c, p)
+ (c.x * c.x + c.y * c.y) * getDblOrientedTriangleArea(a, b, p)
- (p.x * p.x + p.y * p.y) * getDblOrientedTriangleArea(a, b, c) > 0;
return within;
}
在这里,当检查外接圆条件时,边界点会被明确地检查,因此它们可以有效地被视为“无限远”。这比你所描述的找出所有几何含义要容易得多。