Skip to content

Commit 90a6f84

Browse files
rsneddsymonds
authored andcommitted
s2: Clarify docs on CellID.distanceFromBegin.
Signed-off-by: David Symonds <dsymonds@golang.org>
1 parent 34624d3 commit 90a6f84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

s2/cellid.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,10 @@ func (ci *CellID) decode(d *decoder) {
495495
// TODO: the methods below are not exported yet. Settle on the entire API design
496496
// before doing this. Do we want to mirror the C++ one as closely as possible?
497497

498-
// distanceFromBegin returns the number of steps that this cell is from the first
499-
// node in the S2 hierarchy at our level. (i.e., FromFace(0).ChildBeginAtLevel(ci.Level())).
498+
// distanceFromBegin returns the number of steps along the Hilbert curve that
499+
// this cell is from the first node in the S2 hierarchy at our level. (i.e.,
500+
// FromFace(0).ChildBeginAtLevel(ci.Level())). This is analogous to Pos(), but
501+
// for this cell's level.
500502
// The return value is always non-negative.
501503
func (ci CellID) distanceFromBegin() int64 {
502504
return int64(ci >> uint64(2*(maxLevel-ci.Level())+1))

0 commit comments

Comments
 (0)