kdbush

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KDBush

type KDBush[T any] struct {
	NodeSize int
	Points   []Point[T]
	// contains filtered or unexported fields
}

func NewBush

func NewBush[T any](points []Point[T], nodeSize int) *KDBush[T]

func (*KDBush[T]) Range

func (bush *KDBush[T]) Range(minX, minY, maxX, maxY float64) []int

Finds all items within the given bounding box and returns an array of indices that refer to the items in the original points input slice.

func (*KDBush[T]) Within

func (bush *KDBush[T]) Within(qx, qy float64, radius float64, handler func(p Point[T]) bool)

type Lane

type Lane[T any] struct {
	// contains filtered or unexported fields
}

func NewLane

func NewLane[T any]() *Lane[T]

func (*Lane[T]) Add

func (l *Lane[T]) Add(p Point[T])

type Point

type Point[T any] struct {
	X, Y float64
	//	Prev, Next *Point[T]
	Data T
}

Minimal struct, that implements Point interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL