func (n *node) depth() int {
	var d = 1
	for !n.isLeaf {
		d++
		n = n.entries[0].child
	}
	return d
}
depth calculates the number of layers of nodes in the subtree rooted at the node.
package rtree
import (
	"errors"
)
type node struct {
	entries    [1 + maxChildren]entry
	numEntries int
	parent     *node
	isLeaf     bool
}
type entry struct {
	box Box
	child    *node
	recordID int
}
func (n *node) appendRecord(box Box, recordID int) {
	n.entries[n.numEntries] = entry{box: box, recordID: recordID}
	n.numEntries++
}
func (n *node) appendChild(box Box, child *node) {
	n.entries[n.numEntries] = entry{box: box, child: child}
	n.numEntries++
	child.parent = n
}