peterstace / simplefeatures

Simple Features is a pure Go Implementation of the OpenGIS Simple Feature Access Specification
MIT License
130 stars 19 forks source link

Use robust Line-Line intersection algorithm #274

Open peterstace opened 3 years ago

peterstace commented 3 years ago

The approach given in Line Segment Intersection Testing by Yong-Kang Zhu, Jun-Hai Yong, Guo-Qin Zheng promises to give a robust line/line intersection algorithm that has error at most 1 ULP.

It looks very interesting and involves some clever float64 manipulation.

peterstace commented 3 years ago

The qd library has some existing double-double algorithms implemented, which may be useful: https://www.davidhbailey.com/dhbsoftware/