// Coords returns all the coordinates in g, i.e. a single coordinate.
763558
func (g *geom0) Coords() Coord {
	return inflate0(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
949201
func (c *RPCClient) GetCoordinate(node string) (*coordinate.Coordinate, error) {
	header := requestHeader{
		Command: getCoordinateCommand,
		Seq:     c.getSeq(),
	}
	req := coordinateRequest{
		Node: node,
	}
	var resp coordinateResponse

	if err := c.genericRPC(&header, &req, &resp); err != nil {
		return nil, err
	}
	if resp.Ok {
		return &resp.Coord, nil
	}
	return nil, nil
}
353264
func (g *Point) MustSetCoords(coords Coord) *Point {
	Must(g.SetCoords(coords))
	return g
}
1269267
func Centroid(geometry geom.T) (centroid geom.Coord, err error) {
	switch t := geometry.(type) {
	case *geom.Point:
		centroid = PointsCentroid(t)
	case *geom.MultiPoint:
		centroid = MultiPointCentroid(t)
	case *geom.LineString:
		centroid = LinesCentroid(t)
	case *geom.LinearRing:
		centroid = LinearRingsCentroid(t)
	case *geom.MultiLineString:
		centroid = MultiLineCentroid(t)
	case *geom.Polygon:
		centroid = PolygonsCentroid(t)
	case *geom.MultiPolygon:
		centroid = MultiPolygonCentroid(t)
	default:
		err = fmt.Errorf("%v is not a supported type for centroid calculation", t)
	}

	return centroid, err
}
1128748
func (d *L3GD20) Orientations() (<-chan Orientation, error) {
	if err := d.setup(); err != nil {
		return nil, err
	}

	return d.orientations, nil
}
284364
func Cor(x, y Vector) (float64, error) {
	n := float64(len(x))
	xy, err := Product(x, y)
	if err != nil {
		return NA, err
	}

	sx := x.Sd()
	sy := y.Sd()

	mx := x.Mean()
	my := y.Mean()

	r := (xy.Sum() - n*mx*my) / ((n - 1) * sx * sy)
	return r, nil
}
390676
func (w *CurrentWeatherData) CurrentByCoordinates(location *Coordinates) error {
	response, err := w.client.Get(fmt.Sprintf(fmt.Sprintf(baseURL, "appid=%s&lat=%f&lon=%f&units=%s&lang=%s"), w.Key, location.Latitude, location.Longitude, w.Unit, w.Lang))
	if err != nil {
		return err
	}
	defer response.Body.Close()

	if err = json.NewDecoder(response.Body).Decode(&w); err != nil {
		return err
	}

	return nil
}
835420
func (t *Polygon) AddCoordinates(coordinates ...Coordinates) {
	t.Coordinates = append(t.Coordinates, coordinates...)
}
811108
func (t *LineString) AddCoordinates(c ...Coordinate) {
	t.Coordinates = append(t.Coordinates, c...)
}
1019515
func NewFlatCoordSorting2D(layout geom.Layout, coordData []float64) FlatCoord {
	return NewFlatCoordSorting(layout, coordData, IsLess2D)
}
248702
func (g *LinearRing) MustSetCoords(coords []Coord) *LinearRing {
	Must(g.SetCoords(coords))
	return g
}
1048553
func cos(a float64) float64 {
	if a < 0.0 {
		a = -a
	}
	if a > sinCosMaxValueForIntModulo {
		return math.Cos(a)
	}
	// index: possibly outside tables range.
	index := int(a*sinCosIndexer + 0.5)
	delta := (a - float64(index)*sinCosDeltaHi) - float64(index)*sinCosDeltaLo
	// Making sure index is within tables range.
	// Last value of each table is the same than first, so we ignore it (tabs size minus one) for modulo.
	index &= (sinCosTabsSize - 2) // index % (SIN_COS_TABS_SIZE-1)
	indexCos := cosTab[index]
	indexSin := sinTab[index]
	return indexCos + delta*(-indexSin+delta*(-indexCos*oneDivF2+delta*(indexSin*oneDivF3+delta*indexCos*oneDivF4)))
}
1247578
func (u *Ugen) Cos() Input {
	return unaryOpCos(u.Rate, u, u.NumOutputs)
}
888501
func ConvexHull(geometry geom.T) geom.T {
	// copy coords because the algorithm reorders them
	calc := convexHullCalculator{
		layout:   geometry.Layout(),
		stride:   geometry.Layout().Stride(),
		inputPts: geometry.FlatCoords(),
	}

	return calc.getConvexHull()
}
1062328
func cosDistance(x, y Point) (cos, err float64) {
	cos = x.Dot(y.Vector)
	return cos, 9.5*dblError*math.Abs(cos) + 1.5*dblError
}
1356550
func sourceCoordinates(asm map[int]nodes) (start, end int) {
	for l := range asm {
		if start == 0 || l < start {
			start = l
		}
		if end == 0 || l > end {
			end = l
		}
	}
	return start, end
}
1033210
func (r Rect) Lo() LatLng {
	return LatLng{s1.Angle(r.Lat.Lo) * s1.Radian, s1.Angle(r.Lng.Lo) * s1.Radian}
}