quadtreego

package module
v0.0.0-...-6eadd46 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 6 Imported by: 0

README

Quadtree (go)

This is a golang port of my Java Quadtree

CircleCI

Code is released under MIT licence, so go ahead and use it in your projects.

I hope you find it useful.

[email protected]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HLine

func HLine(x1, y, x2 int, img image.RGBA, col color.Color)

func Rect

func Rect(x1, y1, x2, y2 int, img image.RGBA, col color.Color)

Rect draws a rectangle utilizing HLine() and VLine()

func VLine

func VLine(x, y1, y2 int, img image.RGBA, col color.Color)

VLine draws a veritcal line

Types

type Node

type Node struct {
	Left     float64
	Top      float64
	Width    float64
	Height   float64
	Parent   *Node
	NW       *Node
	NE       *Node
	SW       *Node
	SE       *Node
	Point    Point
	NodeType NodeType
}

type NodeType

type NodeType int
const (
	EMPTY NodeType = iota
	LEAF
	POINTER
)

type Point

type Point struct {
	X      float64
	Y      float64
	Weight interface{}
}

type Quadtree

type Quadtree struct {
	Root  Node
	Count int
}

func NewQuadTree

func NewQuadTree(minX float64, minY float64, maxX float64, maxY float64) *Quadtree

Jump to

Keyboard shortcuts

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