tree

package
v0.0.0-...-ceef3df Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: Unlicense Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Min   *Point
	Max   *Point
	Depth int32
}

木の頂点。1つの領域を示す。

func (*Node) Adjacent

func (n *Node) Adjacent() []*Node

その頂点と同じ深さの8近傍を返す。

func (*Node) Children

func (n *Node) Children() []*Node

その頂点の子を返す

func (*Node) IsInside

func (n *Node) IsInside(p *Point) bool

func (*Node) Mid

func (n *Node) Mid() *Point

type Point

type Point struct {
	X float64
	Y float64
}

座標

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

func NewTree

func NewTree(min *Point, max *Point) *Tree

func (*Tree) Path

func (t *Tree) Path(p *Point, depth int32) (*Node, string)

Jump to

Keyboard shortcuts

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