hilbert

package
v0.0.0-...-e2c65c2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(h int, scale int) image.Point

Decode returns the point corresponding to a given position along a Hilbert curve of particular size.

func Encode

func Encode(pt image.Point, scale int) int

Encode returns the linear index of a point along a Hilbert curve for a given scale.

Types

type Scale

type Scale int

Scale is the width and height of a Hilbert space-filling curve. The scale must be a power of two.

func (Scale) Decode

func (scale Scale) Decode(hi int) image.Point

Decode returns the point at the given offset of a Hilbert curve with this scale.

func (Scale) Encode

func (scale Scale) Encode(pt image.Point) int

Encode returns the linear index of a point along a Hilbert curve with this scale.

Jump to

Keyboard shortcuts

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