The Generalization of Bentley-Ottmann Algorithm

前端 未结 2 765
悲&欢浪女
悲&欢浪女 2020-12-16 04:58

Bentley-Ottmann Algorithm is used to determined the intersection point of a list of lines. However as mentioned here in Wiki, there are a few drawbacks:

2条回答
  •  一个人的身影
    2020-12-16 05:36

    The Wikipedia article you linked to has a section on handling these special positions, which suggests these modifications to the basic algorithm:

    • By convention, a point is to the "left" of a point vertically above it; thus the "left" endpoint of a vertical line is its lower endpoint.
    • Events may consist of the crossings of two or more lines.
    • When an event point is reached, its incident segments must be reversed in the sweep line (not just swapped, as there may be more than two).
    • After a crossing is handled, there may be more than two old event points to be removed or more than two new event points to be inserted.

提交回复
热议问题