// RingContains returns true if the point is inside the ring.
// Points on the boundary are considered in.
540664
func RingContains(r orb.Ring, point orb.Point) bool {
	if !r.Bound().Contains(point) {
		return false
	}

	c, on := rayIntersect(point, r[0], r[len(r)-1])
	if on {
		return true
	}

	for i := 0; i < len(r)-1; i++ {
		inter, on := rayIntersect(point, r[i], r[i+1])
		if on {
			return true
		}

		if inter {
			c = !c
		}
	}

	return c
}
214814
func attributeContainsValue(attr html.Attribute, attribute, value string) bool {
	if attr.Key == attribute {
		for _, attrVal := range strings.Fields(attr.Val) {
			if attrVal == value {
				return true
			}
		}
	}
	return false
}
38172
func (c Cap) ContainsPoint(p Point) bool {
	return c.center.Sub(p.Vector).Norm2() <= 2*c.height
}
726366
func byteSliceContains(a []byte, b byte) bool {
	for _, v := range a {
		if v == b {
			return true
		}
	}

	return false
}
1142996
func (box *Box) ContainsPoint(p *T) bool {
	return p[0] >= box.Min[0] && p[0] <= box.Max[0] &&
		p[1] >= box.Min[1] && p[1] <= box.Max[1] &&
		p[2] >= box.Min[2] && p[2] <= box.Max[2]
}
690674
func (s *String) NotContains(value string) *String {
	if strings.Contains(s.value, value) {
		s.chain.fail(
			"\nexpected string not containing substring:\n %q\n\nbut got:\n %q",
			value, s.value)
	}
	return s
}
193123
func (r Rect) InteriorContainsPoint(p Point) bool {
	return r.X.InteriorContains(p.X) && r.Y.InteriorContains(p.Y)
}
775910
func AccessModesContains(modes []v1.PersistentVolumeAccessMode, mode v1.PersistentVolumeAccessMode) bool {
	for _, m := range modes {
		if m == mode {
			return true
		}
	}
	return false
}
282085
func (c Circle) Contains(u Vec) bool {
	toCenter := c.Center.To(u)
	return c.Radius >= toCenter.Len()
}
1180554
func (i Interval) InteriorContains(p float64) bool {
	return i.Lo < p && p < i.Hi
}
1229574
func AttrContains(e Markup, f, val string) bool {
	for _, as := range e.Attributes() {
		if !strings.Contains(as.Name, f) {
			continue
		}

		if val != "" {
			if !strings.Contains(as.Value, val) {
				continue
			}
		}

		return true
	}

	return false
}
202642
func (c Cap) ContainsPoint(p Point) bool {
	return ChordAngleBetweenPoints(c.center, p) <= c.radius
}
132739
func (b *Builder) Ring() *Ring {
	ring := &Ring{
		nodes:                    make([]*Node, len(b.nodes)),
		groups:                   make([]*Group, len(b.groups)),
		nodeToGroup:              make([]int, len(b.nodes)),
		groupToGroup:             make([]int, len(b.groups)),
		replicaToPartitionToNode: make([][]lowring.Node, len(b.ring.ReplicaToPartitionToNode)),
		rebalanced:               b.ring.Rebalanced,
	}
	for i, n := range b.nodes {
		ring.nodes[i] = &Node{
			ring:     ring,
			index:    i,
			info:     n.info,
			capacity: b.ring.NodeToCapacity[i],
		}
	}
	for i, g := range b.groups {
		ring.groups[i] = &Group{
			ring:  ring,
			index: i,
			info:  g.info,
		}
	}
	copy(ring.nodeToGroup, b.ring.NodeToGroup)
	copy(ring.groupToGroup, b.ring.GroupToGroup)
	replicaCount := len(b.ring.ReplicaToPartitionToNode)
	partitionCount := len(b.ring.ReplicaToPartitionToNode[0])
	for replica := 0; replica < replicaCount; replica++ {
		ring.replicaToPartitionToNode[replica] = make([]lowring.Node, partitionCount)
		copy(ring.replicaToPartitionToNode[replica], b.ring.ReplicaToPartitionToNode[replica])
	}
	return ring
}
641123
func deriveContains(list []int, item int) bool {
	for _, v := range list {
		if v == item {
			return true
		}
	}
	return false
}
742716
func Ring(b orb.Bound, r orb.Ring) orb.Ring {
	result := ring(b, r)
	if len(result) == 0 {
		return nil
	}

	return result
}
723284
func (p *Pattern) geoConcentricCircles() {
	scale := utils.HexVal(p.Hash, 0, 1)
	ringSize := utils.Map(scale, 0, 15, 10, 60)
	strokeWidth := ringSize / 5

	p.Svg.SetHeight(int((ringSize + strokeWidth) * 6))
	p.Svg.SetWidth(int((ringSize + strokeWidth) * 6))

	i := 0
	for y := 0; y <= 5; y++ {
		for x := 0; x <= 5; x++ {

			val := utils.HexVal(p.Hash, i, 1)
			opacity := utils.Opacity(val)
			fill := utils.FillColor(val)

			cx := float64(x)*ringSize + float64(x)*strokeWidth + (ringSize+strokeWidth)/2
			cy := float64(y)*ringSize + float64(y)*strokeWidth + (ringSize+strokeWidth)/2

			styles := make(map[string]interface{})
			styles["fill"] = "none"
			styles["stroke"] = fill
			styles["style"] = map[string]string{"opacity": fmt.Sprintf("%v", opacity), "stroke-width": fmt.Sprintf("%vpx", strokeWidth)}

			p.Svg.Circle(cx, cy, ringSize/2, styles)

			val = utils.HexVal(p.Hash, 39-i, 1)
			opacity = utils.Opacity(val)
			fill = utils.FillColor(val)

			styles = make(map[string]interface{})
			styles["fill"] = fill
			styles["fill-opacity"] = opacity

			p.Svg.Circle(cx, cy, ringSize/4, styles)

			i = i + 1
		}
	}
}
1287809
func IsPointWithinLineBounds(p, lineEndpoint1, lineEndpoint2 geom.Coord) bool {
	minx := math.Min(lineEndpoint1[0], lineEndpoint2[0])
	maxx := math.Max(lineEndpoint1[0], lineEndpoint2[0])
	miny := math.Min(lineEndpoint1[1], lineEndpoint2[1])
	maxy := math.Max(lineEndpoint1[1], lineEndpoint2[1])
	return minx <= p[0] && maxx >= p[0] && miny <= p[1] && maxy >= p[1]
}