Closed djadala closed 8 years ago
@rsned ?
Hah, it looks like the C++ we ported from also has this mistake.
Actually, it's just a misleading comment. It isn't saying it returns vertex k (mod 4)
, but only vertex k+1 (mod 4)
, implicitly assuming that k is 0-3.
I'll clarify the doc comment.
Cell.Edge returns edge from vertex 3 to vertex 0 if k >= 3, documentation claim: edge from vertex k to vertex k+1 (mod 4)
switch should be
switch k%4 {
orswitch k&0x03 {
https://github.com/golang/geo/blob/master/s2/cell.go#L78