Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Axdex ¶
type Axdex struct {
// contains filtered or unexported fields
}
func NewAxdex ¶
NewAxdex returns a new axis-based index with the provided capacity. It's assumed that you will insert exactly `capacity` points before running queries against the index.
type Index ¶
type Index interface { // NearestN returns up the `n` nearest neighbors of the point, with // a `max` search distance. `n` May be set to -1 to search for all // neighbors in the distance.8 NearestN(p *Point, n int, max float32) []*Point // Points returns all points contained in the spatial index. Points() []*Point }
Index describes a spatial index that can look up a point's nearest neighbors.
type Point ¶
type Point struct{ X, Y float32 }
Point represents a point in two-dimensional space.
func (*Point) DistanceToSqr ¶
DistanceToSqr returns the squared distance to the `other` point.
Click to show internal directories.
Click to hide internal directories.