peterstace / simplefeatures

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

Fix incorrect line/line intersection on `aarch64` #501

Closed peterstace closed 1 year ago

peterstace commented 1 year ago

Description

Fixes a bug where the result of intersecting two lines segments is sometimes incorrect.

The bug only occurs in aarch64 and is due to an unanticipated fused multiply-add (FMA) operation. The FMA causes the cross product method to return very small but non-zero results for linearly dependent inputs (i.e. two vectors that are scaled versions of each other).

The bug does not occur on x64_64.

Check List

Have you:

Related Issue

peterstace commented 1 year ago

Thanks for reviewing!