// Length returns the length of the boundary of the geometry
// using 2d euclidean geometry.
544878
func Length(g orb.Geometry, df orb.DistanceFunc) float64 {
	if g == nil {
		return 0
	}

	switch g := g.(type) {
	case orb.Point:
		return 0
	case orb.MultiPoint:
		return 0
	case orb.LineString:
		return lineStringLength(g, df)
	case orb.MultiLineString:
		sum := 0.0
		for _, ls := range g {
			sum += lineStringLength(ls, df)
		}

		return sum
	case orb.Ring:
		return lineStringLength(orb.LineString(g), df)
	case orb.Polygon:
		return polygonLength(g, df)
	case orb.MultiPolygon:
		sum := 0.0
		for _, p := range g {
			sum += polygonLength(p, df)
		}

		return sum
	case orb.Collection:
		sum := 0.0
		for _, c := range g {
			sum += Length(c, df)
		}

		return sum
	case orb.Bound:
		return Length(g.ToRing(), df)
	}

	panic(fmt.Sprintf("geometry type not supported: %T", g))
}
1090891
func (a *Array) Length() *Number {
	return &Number{a.chain, float64(len(a.value))}
}
1081394
func (s *SeriesCollection) Length() int {
	switch {
	case s.Points != nil:
		return len(s.Points)
	case s.Keys != nil:
		return len(s.Keys)
	case s.SeriesKeys != nil:
		return len(s.SeriesKeys)
	case s.Names != nil:
		return len(s.Names)
	case s.Tags != nil:
		return len(s.Tags)
	case s.Types != nil:
		return len(s.Types)
	case s.SeriesIDs != nil:
		return len(s.SeriesIDs)
	default:
		return 0
	}
}
361006
func (f *MaxStreamDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.ByteOffset))
}
498135
func (body *Body) Length() int64 {
	if body == nil {
		return 0
	}
	return int64(len(body.b))
}
1095217
func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	length := 1 + utils.VarIntLen(uint64(f.StreamID))
	if f.Offset != 0 {
		length += utils.VarIntLen(uint64(f.Offset))
	}
	if f.DataLenPresent {
		length += utils.VarIntLen(uint64(f.DataLen()))
	}
	return length + f.DataLen()
}
546474
func Length(p0, p1, p2 *vec2.T, t float64) float64 {
	ax := p0[0] - 2*p1[0] + p2[0]
	ay := p0[1] - 2*p1[1] + p2[1]
	bx := 2*p1[0] - 2*p0[0]
	by := 2*p1[1] - 2*p0[1]

	a := 4 * (ax*ax + ay*ay)
	b := 4 * (ax*bx + ay*by)
	c := bx*bx + by*by

	abc := 2 * math.Sqrt(a+b+c)
	a2 := math.Sqrt(a)
	a32 := 2 * a * a2
	c2 := 2 * math.Sqrt(c)
	ba := b / a2

	return t * (a32*abc + a2*b*(abc-c2) + (4*c*a-b*b)*math.Log((2*a2+ba+abc)/(ba+c2))) / (4 * a32)
}
336750
func (t *FpdfTpl) Size() (corner PointType, size SizeType) {
	return t.corner, t.size
}
259533
func (lru *LRUCache) Length() int64 {
	lru.mu.Lock()
	defer lru.mu.Unlock()
	return int64(lru.list.Len())
}
982010
func (f *MaxStreamsFrame) Length(protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(f.MaxStreams)
}
559644
func (b *circularRuneBuffer) length() int {
	return len(b.runes) + int(b.offset)
}
1286210
func Length(base ErrorObject) int {
	length := 0
	if err := WalkErrors(base, func(errcomp ErrorObject) (stop bool, walkerr error) {
		length++
		return false, nil
	}); err != nil {
		return -1
	}
	return length
}
502166
func ToLength(input interface{}) (int, bool) {
	if s, ok := input.(string); ok {
		return len(s), true
	}

	value := reflect.ValueOf(input)
	kind := value.Kind()
	if kind == reflect.Array || kind == reflect.Slice || kind == reflect.Map {
		return value.Len(), true
	}
	return 0, false
}
340091
func String(length int) string {
	return base64.RawStdEncoding.EncodeToString(Bytes(length))[:length]
}
180907
func (b *Buffer) Length() int {
	if b == nil || b.C_gss_buffer_t == nil || b.C_gss_buffer_t.length == 0 {
		return 0
	}
	return int(b.C_gss_buffer_t.length)
}
1157807
func (p *Polyline) Length() s1.Angle {
	var length s1.Angle

	for i := 1; i < len(*p); i++ {
		length += (*p)[i-1].Distance((*p)[i])
	}
	return length
}
1234130
func (self *Collection) length() Equaler {
	raw := self.coll.Demand()
	if raw == nil {
		return IntEqualer{I: 0}
	}
	return IntEqualer{len(raw.(EqList))}
}