示例#1
0
func (this Bounds) Intersects(pt Point) bool {
	intersects := true
	dims := util.MinUint8(pt.NumDim(), this.max.NumDim())
	for dim := uint8(0); dim < dims; dim++ {
		ord := pt.Ord(dim)
		intersects = intersects && ord > this.min.Ord(dim) && ord < this.max.Ord(dim)
	}
	return intersects
}
示例#2
0
func (this *Bounds) expandToInclude(pt Point) {
	dims := util.MinUint8(pt.NumDim(), this.max.NumDim())
	for dim := uint8(0); dim < dims; dim++ {
		ord := pt.Ord(dim)
		if ord < this.min.Ord(dim) {
			this.min = derivePoint(dim, ord, this.min)
		} else if ord > this.max.Ord(dim) {
			this.max = derivePoint(dim, ord, this.max)
		}
	}
}