golang / geo

S2 geometry library in Go
Apache License 2.0
1.69k stars 182 forks source link

DEPRECATED: Use CrossingSign(a,b,c,d) == Cross instead. #34

Closed djadala closed 6 years ago

djadala commented 6 years ago

then, why not define:

func SimpleCrossing(a, b, c, d Point) bool {
    return CrossingSign(a,b,c,d) == Cross
}

for backward compatibility ?

dsymonds commented 6 years ago

It's not an exact match for degeneracies (e.g. if the segments cross only at one of the endpoints). You're welcome to drop those lines in your own code.

djadala commented 6 years ago

Is it good idea to include doc comment like:

// deprecated SimpleCrossing function can be replaced with 
// CrossingSign(a,b,c,d) == Cross or 
// CrossingSign(a,b,c,d) != DoNotCross

?

dsymonds commented 6 years ago

That's roughly what had been in the deprecation comment for quite a while.

djadala commented 6 years ago

Sorry for continuing this thread, but i can't see any deprecation comment in sources & godoc, deprecation text is only in commit message, and it suggest replacing with only CrossingSign(a,b,c,d) == Cross.

Again sorry, i will stop posting more messages.

dsymonds commented 6 years ago

If I visit https://github.com/golang/geo/commit/ec03579dafff0d18d92b2c87cb8a2f1bc1c5bc5a, you can see the deprecation notice in s2/edge_crossings.go on line 76 on the left hand side. It suggests using CrossingSign(a,b,c,d) == Cross, but that's not a perfect replacement in every situation.