quadtree

package
v0.0.0-...-8a12d84 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package quadtree provides parallelizable functions for a linear quad tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cap

func Cap(lvl int) int

Cap calculates the required capacity to hold all nodes of a given level.

func Cell

func Cell(key uint32) (nx, ny, size float32)

Cell retrieves normalized coordinates and size.

func Children

func Children(key uint32) (uint32, uint32, uint32, uint32)

Children generates nodes from a quadtree encoded word.

func Decode

func Decode(key uint32) (x, y, level uint32)

Decode retrieves column major position and level from word.

func IsLowerLeft

func IsLowerLeft(key uint32) bool

IsLowerLeft determines if node represents the lower-left child of its parent.

func IsLowerRight

func IsLowerRight(key uint32) bool

IsLowerRight determines if node represents the lower-right child of its parent.

func IsUpperLeft

func IsUpperLeft(key uint32) bool

IsUpperLeft determines if node represents the upper-left child of its parent.

func IsUpperRight

func IsUpperRight(key uint32) bool

IsUpperRight determines if node represents the upper-right child of its parent.

func Parent

func Parent(key uint32) uint32

Parent generates node from quadtree encoded word.

func ProjectMercator

func ProjectMercator(nx, ny float32, radius float32) (x, y, z float32)

ProjectMercator converts normalized coordinates to mercator projection, just for fun.

func Split

func Split(key uint32, lvl int, nodes *[]uint32)

Split recursively collects children at the given level into nodes pointer.

func Undilate

func Undilate(x uint32) uint32

Undilate deinterleaves word using shift-or algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

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