// InteriorContainsPoint returns true iff the given point is contained in the interior
// of the region (i.e. the region excluding its boundary).
193123
func (r Rect) InteriorContainsPoint(p Point) bool {
	return r.X.InteriorContains(p.X) && r.Y.InteriorContains(p.Y)
}
376787
func (p *Polygon) Contains(o *Polygon) bool {
	// If both polygons have one loop, use the more efficient Loop method.
	// Note that Loop's Contains does its own bounding rectangle check.
	if len(p.loops) == 1 && len(o.loops) == 1 {
		return p.loops[0].Contains(o.loops[0])
	}

	// Otherwise if neither polygon has holes, we can still use the more
	// efficient Loop's Contains method (rather than compareBoundary),
	// but it's worthwhile to do our own bounds check first.
	if !p.subregionBound.Contains(o.bound) {
		// Even though Bound(A) does not contain Bound(B), it is still possible
		// that A contains B. This can only happen when union of the two bounds
		// spans all longitudes. For example, suppose that B consists of two
		// shells with a longitude gap between them, while A consists of one shell
		// that surrounds both shells of B but goes the other way around the
		// sphere (so that it does not intersect the longitude gap).
		if !p.bound.Lng.Union(o.bound.Lng).IsFull() {
			return false
		}
	}

	if !p.hasHoles && !o.hasHoles {
		for _, l := range o.loops {
			if !p.anyLoopContains(l) {
				return false
			}
		}
		return true
	}

	// Polygon A contains B iff B does not intersect the complement of A. From
	// the intersection algorithm below, this means that the complement of A
	// must exclude the entire boundary of B, and B must exclude all shell
	// boundaries of the complement of A. (It can be shown that B must then
	// exclude the entire boundary of the complement of A.) The first call
	// below returns false if the boundaries cross, therefore the second call
	// does not need to check for any crossing edges (which makes it cheaper).
	return p.containsBoundary(o) && o.excludesNonCrossingComplementShells(p)
}
846279
func (c Cell) uEdgeIsClosest(p Point, vHi bool) bool {
	u0 := c.uv.X.Lo
	u1 := c.uv.X.Hi
	v := c.uv.Y.Lo
	if vHi {
		v = c.uv.Y.Hi
	}
	// These are the normals to the planes that are perpendicular to the edge
	// and pass through one of its two endpoints.
	dir0 := r3.Vector{v*v + 1, -u0 * v, -u0}
	dir1 := r3.Vector{v*v + 1, -u1 * v, -u1}
	return p.Dot(dir0) > 0 && p.Dot(dir1) < 0
}
1126581
func TitleContains(tab *Tab, searchTitle string) ConditionalFunc {
	return func(tab *Tab) bool {
		if pageTitle, err := tab.GetTitle(); err == nil && strings.Contains(pageTitle, searchTitle) {
			return true
		}
		return false
	}
}
737321
func (rc *RegionCoverer) InteriorCovering(region Region) CellUnion {
	intCovering := rc.InteriorCellUnion(region)
	intCovering.Denormalize(maxInt(0, minInt(maxLevel, rc.MinLevel)), maxInt(1, minInt(3, rc.LevelMod)))
	return intCovering
}
1060688
func (r Rect) ContainsCell(c Cell) bool {
	// A latitude-longitude rectangle contains a cell if and only if it contains
	// the cell's bounding rectangle. This test is exact from a mathematical
	// point of view, assuming that the bounds returned by Cell.RectBound()
	// are tight. However, note that there can be a loss of precision when
	// converting between representations -- for example, if an s2.Cell is
	// converted to a polygon, the polygon's bounding rectangle may not contain
	// the cell's bounding rectangle. This has some slightly unexpected side
	// effects; for instance, if one creates an s2.Polygon from an s2.Cell, the
	// polygon will contain the cell, but the polygon's bounding box will not.
	return r.Contains(c.RectBound())
}
200287
func (p *Polygon) iteratorContainsPoint(it *ShapeIndexIterator, point Point) bool {
	// Test containment by drawing a line segment from the cell center to the
	// given point and counting edge crossings.
	aClipped := it.IndexCell().findByShapeID(0)
	inside := aClipped.containsCenter

	if len(aClipped.edges) == 0 {
		return inside
	}

	// This block requires ShapeIndex.
	crosser := NewEdgeCrosser(it.Center(), point)
	shape := p.index.Shape(0)
	for _, e := range aClipped.edges {
		edge := shape.Edge(e)
		inside = inside != crosser.EdgeOrVertexCrossing(edge.V0, edge.V1)
	}

	return inside
}
778807
public boolean contains(CmsPoint point) {

        return (point.getX() >= m_left)
            && (point.getX() < (m_left + m_width))
            && (point.getY() >= m_top)
            && (point.getY() < (m_top + m_height));
    }
925567
func (c Cap) intersects(cell Cell, vertices [4]Point) bool {
	// If the cap is a hemisphere or larger, the cell and the complement of the cap
	// are both convex. Therefore since no vertex of the cell is contained, no other
	// interior point of the cell is contained either.
	if c.radius >= s1.RightChordAngle {
		return false
	}

	// We need to check for empty caps due to the center check just below.
	if c.IsEmpty() {
		return false
	}

	// Optimization: return true if the cell contains the cap center. This allows half
	// of the edge checks below to be skipped.
	if cell.ContainsPoint(c.center) {
		return true
	}

	// At this point we know that the cell does not contain the cap center, and the cap
	// does not contain any cell vertex. The only way that they can intersect is if the
	// cap intersects the interior of some edge.
	sin2Angle := c.radius.Sin2()
	for k := 0; k < 4; k++ {
		edge := cell.Edge(k).Vector
		dot := c.center.Vector.Dot(edge)
		if dot > 0 {
			// The center is in the interior half-space defined by the edge. We do not need
			// to consider these edges, since if the cap intersects this edge then it also
			// intersects the edge on the opposite side of the cell, because the center is
			// not contained with the cell.
			continue
		}

		// The Norm2() factor is necessary because "edge" is not normalized.
		if dot*dot > sin2Angle*edge.Norm2() {
			return false
		}

		// Otherwise, the great circle containing this edge intersects the interior of the cap. We just
		// need to check whether the point of closest approach occurs between the two edge endpoints.
		dir := edge.Cross(c.center.Vector)
		if dir.Dot(vertices[k].Vector) < 0 && dir.Dot(vertices[(k+1)&3].Vector) > 0 {
			return true
		}
	}
	return false
}
632157
func (i Interval) InteriorIntersects(oi Interval) bool {
	return oi.Lo < i.Hi && i.Lo < oi.Hi && i.Lo < i.Hi && oi.Lo <= oi.Hi
}
853131
func MultiPolygonContains(mp orb.MultiPolygon, point orb.Point) bool {
	for _, p := range mp {
		if PolygonContains(p, point) {
			return true
		}
	}

	return false
}
267699
func (r Region) Contains(point int) bool {
	return point >= r.Begin() && point <= r.End()
}
653321
func (r Rect) ContainsPoint(p Point) bool {
	return r.ContainsLatLng(LatLngFromPoint(p))
}
1104277
func (region *Region) ContainsPoint(x, y int) bool {
	ret := C.cairo_region_contains_point(region.Ptr, C.int(x), C.int(y)) != 0
	if err := region.status(); err != nil {
		panic(err)
	}
	return ret
}
828904
func ExtractInsideBoundingBox(opts ...interface{}) *opt.InsideBoundingBoxOption {
	for _, o := range opts {
		if v, ok := o.(*opt.InsideBoundingBoxOption); ok {
			return v
		}
	}
	return nil
}
724713
func (q *ContainsPointQuery) shapeContains(clipped *clippedShape, center, p Point) bool {
	inside := clipped.containsCenter
	numEdges := clipped.numEdges()
	if numEdges <= 0 {
		return inside
	}

	shape := q.index.Shape(clipped.shapeID)
	if shape.Dimension() != 2 {
		// Points and polylines can be ignored unless the vertex model is Closed.
		if q.model != VertexModelClosed {
			return false
		}

		// Otherwise, the point is contained if and only if it matches a vertex.
		for _, edgeID := range clipped.edges {
			edge := shape.Edge(edgeID)
			if edge.V0 == p || edge.V1 == p {
				return true
			}
		}
		return false
	}

	// Test containment by drawing a line segment from the cell center to the
	// given point and counting edge crossings.
	crosser := NewEdgeCrosser(center, p)
	for _, edgeID := range clipped.edges {
		edge := shape.Edge(edgeID)
		sign := crosser.CrossingSign(edge.V0, edge.V1)
		if sign == DoNotCross {
			continue
		}
		if sign == MaybeCross {
			// For the Open and Closed models, check whether p is a vertex.
			if q.model != VertexModelSemiOpen && (edge.V0 == p || edge.V1 == p) {
				return (q.model == VertexModelClosed)
			}
			// C++ plays fast and loose with the int <-> bool conversions here.
			if VertexCrossing(crosser.a, crosser.b, edge.V0, edge.V1) {
				sign = Cross
			} else {
				sign = DoNotCross
			}
		}
		inside = inside != (sign == Cross)
	}

	return inside
}
54731
func (q *ContainsPointQuery) ContainingShapes(p Point) []Shape {
	var shapes []Shape
	q.visitContainingShapes(p, func(shape Shape) bool {
		shapes = append(shapes, shape)
		return true
	})
	return shapes
}