// InsidePolygonEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option.
500592
func InsidePolygonEqual(o1, o2 *InsidePolygonOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
317700
func (vn *VecN) ApproxEqual(vn2 *VecN) bool {
	if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) {
		return false
	}

	for i, el := range vn.vec {
		if !FloatEqual(el, vn2.vec[i]) {
			return false
		}
	}

	return true
}
985119
func (verts Vertices) ValidatePolygon() bool {
	numVerts := len(verts)
	for i := 0; i < numVerts; i++ {
		a := verts[i]
		b := verts[(i+1)%numVerts]
		c := verts[(i+2)%numVerts]

		if vect.Cross(vect.Sub(b, a), vect.Sub(c, b)) > 0.0 {
			return false
		}
	}

	return true
}
1198066
func AttributeForDistinctEqual(o1, o2 *AttributeForDistinctOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
354085
func (p Polyline) Equals(other core.DxfElement) bool {
	if otherPolyline, ok := other.(*Polyline); ok {
		return p.BaseEntity.Equals(otherPolyline.BaseEntity) &&
			core.FloatEquals(p.Elevation, otherPolyline.Elevation) &&
			core.FloatEquals(p.Thickness, otherPolyline.Thickness) &&
			p.Closed == otherPolyline.Closed &&
			p.CurveFitVerticesAdded == otherPolyline.CurveFitVerticesAdded &&
			p.SplineFitVerticesAdded == otherPolyline.SplineFitVerticesAdded &&
			p.Is3dPolyline == otherPolyline.Is3dPolyline &&
			p.Is3dPolygonMesh == otherPolyline.Is3dPolygonMesh &&
			p.PolygonMeshClosedNDir == otherPolyline.PolygonMeshClosedNDir &&
			p.IsPolyfaceMesh == otherPolyline.IsPolyfaceMesh &&
			p.LineTypeParentAround == otherPolyline.LineTypeParentAround &&
			core.FloatEquals(p.DefaultStartWidth, otherPolyline.DefaultStartWidth) &&
			core.FloatEquals(p.DefaultEndWidth, otherPolyline.DefaultEndWidth) &&
			p.VertexCountM == otherPolyline.VertexCountM &&
			p.VertexCountN == otherPolyline.VertexCountN &&
			p.SmoothDensityM == otherPolyline.SmoothDensityM &&
			p.SmoothDensityN == otherPolyline.SmoothDensityN &&
			p.SmoothSurface == otherPolyline.SmoothSurface &&
			p.ExtrusionDirection.Equals(otherPolyline.ExtrusionDirection) &&
			p.Vertices.Equals(otherPolyline.Vertices)
	}
	return false
}
1357459
func (p LWPolyLinePoint) Equals(other LWPolyLinePoint) bool {
	return p.Point.Equals(other.Point) &&
		p.Id == other.Id &&
		core.FloatEquals(p.StartingWidth, other.StartingWidth) &&
		core.FloatEquals(p.EndWidth, other.EndWidth) &&
		core.FloatEquals(p.Bulge, other.Bulge)
}
590364
func (g *MultiPolygon) Polygon(i int) *Polygon {
	offset := 0
	if i > 0 {
		ends := g.endss[i-1]
		offset = ends[len(ends)-1]
	}
	ends := make([]int, len(g.endss[i]))
	if offset == 0 {
		copy(ends, g.endss[i])
	} else {
		for j, end := range g.endss[i] {
			ends[j] = end - offset
		}
	}
	return NewPolygonFlat(g.layout, g.flatCoords[offset:g.endss[i][len(g.endss[i])-1]], ends)
}
68569
func (p PortConfiguration) DeepEquals(o PortConfiguration) bool {
	if len(p) != len(o) {
		return false
	}

	for portName1, port1 := range p {
		port2, ok := o[portName1]

		if !ok || !port1.Equals(port2) {
			return false
		}
	}

	return true
}
1354078
func (s *RadialSimplifier) Polygon(p orb.Polygon) orb.Polygon {
	return polygon(s, p)
}
249416
func (e *ExponentialStrategy) IsEqual(o *ExponentialStrategy) bool {
	if e.opts.first != o.opts.first {
		return false
	}
	if e.opts.max != o.opts.max {
		return false
	}
	return true
}
1023199
func (pg *GoEvtxMap) AnyEqual(path *GoEvtxPath, is []interface{}) bool {
	t, err := pg.Get(path)
	if err != nil {
		return false
	}
	for _, i := range is {
		if reflect.DeepEqual(i, *t) {
			return true
		}
	}
	return false
}
723955
func EqualNode(n1 Node, n2 Node) bool {
	if n1 == nil || n2 == nil {
		return n1 == n2
	}

	k1 := n1.Kind()
	k2 := n2.Kind()

	if k1 != k2 {
		return false
	}

	switch k1 {
	case ArrayNode:
		return equalNodeArray(n1.(Array), n2.(Array))
	case MapNode:
		return equalNodeMap(n1.(Map), n2.(Map))
	default:
		return equalNodeScalar(n1.(Scalar), n2.(Scalar))
	}
}
229761
func Equal(g1, g2 Geometry) bool {
	if g1 == nil || g2 == nil {
		return g1 == g2
	}

	if g1.GeoJSONType() != g2.GeoJSONType() {
		return false
	}

	switch g1 := g1.(type) {
	case Point:
		return g1.Equal(g2.(Point))
	case MultiPoint:
		return g1.Equal(g2.(MultiPoint))
	case LineString:
		return g1.Equal(g2.(LineString))
	case MultiLineString:
		return g1.Equal(g2.(MultiLineString))
	case Ring:
		g2, ok := g2.(Ring)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	case Polygon:
		g2, ok := g2.(Polygon)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	case MultiPolygon:
		return g1.Equal(g2.(MultiPolygon))
	case Collection:
		return g1.Equal(g2.(Collection))
	case Bound:
		g2, ok := g2.(Bound)
		if !ok {
			return false
		}
		return g1.Equal(g2)
	}

	panic(fmt.Sprintf("geometry type not supported: %T", g1))
}
328648
func ExtractInsidePolygon(opts ...interface{}) *opt.InsidePolygonOption {
	for _, o := range opts {
		if v, ok := o.(*opt.InsidePolygonOption); ok {
			return v
		}
	}
	return nil
}
865104
func (s *VisvalingamSimplifier) Polygon(p orb.Polygon) orb.Polygon {
	return polygon(s, p)
}
495782
func (v Vector) GreaterEqual(b Vector) bool {
	comp := v.Compare(b)
	return comp == Greater || comp == Equal
}
785893
func InsideBoundingBoxEqual(o1, o2 *InsideBoundingBoxOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}