// Length returns the length of a hermit spline from pointA to t (0,1).
544998
func Length(pointA, tangentA, pointB, tangentB *vec3.T, t float64) float64 {
	sqrT := t * t
	t1 := sqrT * 0.5
	t2 := sqrT * t * 1.0 / 3.0
	t3 := sqrT*sqrT + 1.0/4.0

	f := 2*t3 - 3*t2 + t
	result := pointA.Scaled(f)

	f = t3 - 2*t2 + t1
	tAf := tangentA.Scaled(f)
	result.Add(&tAf)

	f = t3 - t2
	tBf := tangentB.Scaled(f)
	result.Add(&tBf)

	f = -2*t3 + 3*t2
	pBf := pointB.Scaled(f)
	result.Add(&pBf)

	return result.Length()
}
1111052
func (t *TextBar) Size() (int, int) {
	w, h := 0, 0

	ww, wh := t.left.Size()
	w += ww
	if wh > h {
		h = wh
	}
	ww, wh = t.center.Size()
	w += ww
	if wh > h {
		h = wh
	}
	ww, wh = t.right.Size()
	w += ww
	if wh > h {
		h = wh
	}
	return w, h
}
164231
func Distance(a, b *T) float64 {
	d := Sub(a, b)
	return d.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
}
615147
func Length(p0, p1, p2, p3 *vec2.T, t float64) float64 {
	sqrT := t * t
	t1 := sqrT * 0.5
	t2 := sqrT * t * 1.0 / 3.0
	t3 := sqrT*sqrT + 1.0/4.0

	f := 2*t3 - 3*t2 + t
	result := p0.Scaled(f)

	f = t3 - 2*t2 + t1
	tAf := p1.Scaled(f)
	result.Add(&tAf)

	f = t3 - t2
	tBf := p3.Scaled(f)
	result.Add(&tBf)

	f = -2*t3 + 3*t2
	pBf := p2.Scaled(f)
	result.Add(&pBf)

	return result.Length()
}
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
}
559644
func (b *circularRuneBuffer) length() int {
	return len(b.runes) + int(b.offset)
}
427542
func (pq *PriorityQueue) Length() uint64 {
	pq.RLock()
	defer pq.RUnlock()

	var length uint64
	for _, v := range pq.levels {
		length += v.length()
	}

	return length
}
689691
func (a *assertion) Length(obtained interface{}, expected int, msgs ...string) bool {
	length, err := a.Len(obtained)
	if err != nil {
		return a.failer.Fail(Length, ValueDescription(obtained), expected, err.Error())
	}
	if length != expected {
		return a.failer.Fail(Length, length, expected, msgs...)
	}
	return true
}
327187
func (f *StreamDataBlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.DataLimit))
}
1168241
func (file *ObjectOpenFile) Length() (int64, error) {
	if !file.lengthOk {
		info, _, err := file.connection.Object(file.container, file.objectName)
		file.length = info.Bytes
		file.lengthOk = (err == nil)
		return file.length, err
	}
	return file.length, nil
}
478984
func (s *String) Length() *Number {
	return &Number{s.chain, float64(len(s.value))}
}
741666
func StringLength(str string, params ...string) bool {

	if len(params) == 2 {
		strLength := utf8.RuneCountInString(str)
		min, _ := ToInt(params[0])
		max, _ := ToInt(params[1])
		return strLength >= int(min) && strLength <= int(max)
	}

	return false
}
1234130
func (self *Collection) length() Equaler {
	raw := self.coll.Demand()
	if raw == nil {
		return IntEqualer{I: 0}
	}
	return IntEqualer{len(raw.(EqList))}
}
660405
func (vv *VectorisedView) CapLength(length int) {
	if length < 0 {
		length = 0
	}
	if vv.size < length {
		return
	}
	vv.size = length
	for i := range vv.views {
		v := &vv.views[i]
		if len(*v) >= length {
			if length == 0 {
				vv.views = vv.views[:i]
			} else {
				v.CapLength(length)
				vv.views = vv.views[:i+1]
			}
			return
		}
		length -= len(*v)
	}
}
736550
func (f *NewConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(f.SequenceNumber) + 1 /* connection ID length */ + protocol.ByteCount(f.ConnectionID.Len()) + 16
}
782499
func ToLength(i, rpl string, length int) string {
	if len(i) == length {
		return i
	} else if len(i) > length {
		return i[:length]
	} else {
		for idx := 0; idx <= length-len(i); idx++ {
			i += rpl
		}
		return i
	}
}