You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2018/12/02 13:02:00 UTC

[jira] [Commented] (LUCENE-8583) Make GeoUtils#orientation method more stable

    [ https://issues.apache.org/jira/browse/LUCENE-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16706265#comment-16706265 ] 

Robert Muir commented on LUCENE-8583:
-------------------------------------

Is the new formula really more precise? (substraction etc). 

I'm confused why its necessary: this method was added for the points case (LatLonPoint) where it only runs on quantized values, so it just doesn't need that much precision. And its called in inner loops of points methods that are performance sensitive, so why make it more complex when that much precision isn't being used?

If this is being used for some other reason, maybe that use case should be separate, or just have its own method? It is a problem with trying to make "Utils" methods that are generally useable. Since we aren't a geo library that's not a goal we have to strive for :)


> Make GeoUtils#orientation method more stable
> --------------------------------------------
>
>                 Key: LUCENE-8583
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8583
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>            Reporter: Ignacio Vera
>            Priority: Major
>         Attachments: LUCENE-8583.patch
>
>
> The method GeoUtils#orient is problematic when called with points that are almost collinear but not quite. In that case the sign of the determinant is not reliable, so for example calling the method with points (a, b, c) and with (c, b, a) gives the same orientation. 
> There is a complex implementation described here (https://www.cs.cmu.edu/~quake/robust.html) where the method becomes more reliable. I have been playing with such implementation and still is not 100% reliable.
> My proposal is not to be fully precise and define a precision constant for this method. Therefore whenever the value of determinant is small to that precision, we consider the points to be collinear. In this case the results of the method are reliable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org