// WKT returns the Well Known Text representation of the multipolygon
553655
func (mp MultiPolygon) WKT() string {
	var result string
	switch len(mp.Coordinates) {
	case 0:
		result = "MULTIPOLYGON EMPTY"
	default:
		result = fmt.Sprintf("MULTIPOLYGON (%v)", array4ToWKTCoordinates(mp.Coordinates))
	}
	return result
}
1223676
func (s *RadialSimplifier) MultiPolygon(mp orb.MultiPolygon) orb.MultiPolygon {
	return multiPolygon(s, mp)
}
1095655
func Polygon(box orb.Bound, p orb.Polygon, o orb.Orientation) orb.MultiPolygon {
	if len(p) == 0 {
		return nil
	}

	open, closed := clipRings(box, p)
	if len(open) == 0 {
		// nothing was clipped
		if len(closed) == 0 {
			return nil // everything outside bound
		}

		return orb.MultiPolygon{p} // everything inside bound
	}

	result := smartWrap(box, open, o)
	if len(result) == 1 {
		result[0] = append(result[0], closed...)
	} else {
		for _, i := range closed {
			result = addToMultiPolygon(result, i)
		}
	}

	return result
}
1216564
func (t *Terminfo) TGoto(col, row int) string {
	return t.TParm(t.SetCursor, row, col)
}
275968
func (t *keyValueTree) CopyAt(keys ...string) (KeyValueTree, error) {
	var path []nodeContent
	for _, key := range keys {
		path = append(path, keyValue{key, ""})
	}
	n, err := t.container.root.at(path...)
	if err != nil {
		return nil, err
	}
	nc := &nodeContainer{
		duplicates: t.container.duplicates,
	}
	nc.root = n.deepCopy(nc, nil)
	return &keyValueTree{nc}, nil
}
845770
func (c *BoxChart) NextDataSet(name string, style Style) {
	c.Data = append(c.Data, BoxChartData{name, style, nil})
	ps := PlotStyle(PlotStylePoints | PlotStyleBox)
	c.Key.Entries = append(c.Key.Entries, KeyEntry{Text: name, Style: style, PlotStyle: ps})
}
1279030
func (m *LevelMetadata) Text(enableColor bool) string {
	if enableColor {
		return m.ColorfulText
	}
	return m.RawText
}
842185
func (wpr *Wrapper) WriteAt(p []byte, off int64) (n int, err error) {
	wrap := NewWrapWriter(wpr.rwa, wpr.O+off, wpr.N)
	w := limio.LimitWriter(wrap, wpr.N-off)
	n, err = w.Write(p)
	if wpr.L < off+int64(n) {
		wpr.L = int64(n) + off
	}
	return n, err
}
404247
func (wpr *Wrapper) ReadAt(p []byte, off int64) (n int, err error) {
	wrap := NewWrapReader(wpr.rwa, wpr.O+off, wpr.N)
	r := io.LimitReader(wrap, wpr.L-off)
	return r.Read(p)
}
659535
func NewText(tags core.TagSlice) (*Text, error) {
	text := new(Text)

	// set default
	text.RelativeXScale = 1.0
	text.StyleName = "STANDARD"
	text.ExtrusionDirection = core.Point{X: 0.0, Y: 0.0, Z: 1.0}

	text.InitBaseEntityParser()
	text.Update(map[int]core.TypeParser{
		1:  core.NewStringTypeParserToVar(&text.Value),
		7:  core.NewStringTypeParserToVar(&text.StyleName),
		10: core.NewFloatTypeParserToVar(&text.FirstAlignmentPoint.X),
		20: core.NewFloatTypeParserToVar(&text.FirstAlignmentPoint.Y),
		30: core.NewFloatTypeParserToVar(&text.FirstAlignmentPoint.Z),
		39: core.NewFloatTypeParserToVar(&text.Thickness),
		40: core.NewFloatTypeParserToVar(&text.Height),
		41: core.NewFloatTypeParserToVar(&text.RelativeXScale),
		50: core.NewFloatTypeParserToVar(&text.Rotation),
		51: core.NewFloatTypeParserToVar(&text.ObliqueAngle),
		71: core.NewIntTypeParser(func(flags int) {
			text.MirroredX = flags&backwardTextBit != 0
			text.MirroredY = flags&upsideDownTextBit != 0
		}),
		72: core.NewIntTypeParser(func(value int) {
			text.HorizontalJustification = HorizontalTextJustification(value)
		}),
		73: core.NewIntTypeParser(func(value int) {
			text.VerticalJustification = VerticalTextJustification(value)
		}),
		11:  core.NewFloatTypeParserToVar(&text.SecondAlignmentPoint.X),
		21:  core.NewFloatTypeParserToVar(&text.SecondAlignmentPoint.Y),
		31:  core.NewFloatTypeParserToVar(&text.SecondAlignmentPoint.Z),
		210: core.NewFloatTypeParserToVar(&text.ExtrusionDirection.X),
		220: core.NewFloatTypeParserToVar(&text.ExtrusionDirection.Y),
		230: core.NewFloatTypeParserToVar(&text.ExtrusionDirection.Z),
	})

	err := text.Parse(tags)
	return text, err
}
451198
func (clnt *Clnt) Wstat(fid *Fid, dir *Dir) error {
	tc := clnt.NewFcall()
	err := PackTwstat(tc, fid.Fid, dir, clnt.Dotu)
	if err != nil {
		return err
	}

	_, err = clnt.Rpc(tc)
	return err
}
853131
func MultiPolygonContains(mp orb.MultiPolygon, point orb.Point) bool {
	for _, p := range mp {
		if PolygonContains(p, point) {
			return true
		}
	}

	return false
}
1318165
func NewSketch(w uint, d uint, exp float64) (*Sketch, error) {
	store := make([][]uint16, d, d)
	for i := uint(0); i < d; i++ {
		store[i] = make([]uint16, w, w)
	}
	return &Sketch{
		w:     w,
		d:     d,
		exp:   exp,
		store: store,
	}, nil
}
492070
func WKurtosisMeanSd(w, data Interface, wmean, wsd float64) float64 {

	var wavg, W float64
	Len := data.Len()

	for i := 0; i < Len; i++ {
		wi := w.Get(i)

		if wi > 0 {
			x := (data.Get(i) - wmean) / wsd
			W += wi
			wavg += (x*x*x*x - wavg) * (wi / W)
		}
	}

	return wavg - 3.0 // makes kurtosis zero for a Gaussian
}
28157
func (g *Geometry) WKB() ([]byte, error) {
	encoder := newWkbEncoder()
	return encoder.encode(g)
}
873927
func (v *ComboBox) InsertText(text string, position int) {
	deprecated_since(2, 24, 0, "gtk_combo_box_insert_text()")
	ptr := C.CString(text)
	defer cfree(ptr)
	C.gtk_combo_box_insert_text(COMBO_BOX(v), gint(position), gstring(ptr))
}
1197432
func WmDesktopSet(xu *xgbutil.XUtil, win xproto.Window, desk uint) error {
	return xprop.ChangeProp32(xu, win, "_NET_WM_DESKTOP", "CARDINAL",
		uint(desk))
}