morton

package module
v0.0.0-...-94709bd Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: BSD-3-Clause Imports: 1 Imported by: 3

README

Morton Pack/Unpack Library GoDoc Build Status

Basics

Check [[https://en.wikipedia.org/wiki/Z-order_curve][wikipedia]] for details.

Example

import "github.com/gojuno/go.morton"

m := morton.Make64(2, 32) // 2 dimenstions 32 bits each
code := m.Pack(13, 42)    // pack two values
values := m.Unpack(code)  // should get back 13 and 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Morton64

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

func Make64

func Make64(dimensions uint64, bits uint64) *Morton64

func (*Morton64) Pack

func (morton *Morton64) Pack(values ...uint64) int64

func (*Morton64) SPack

func (morton *Morton64) SPack(values ...int64) int64

func (*Morton64) SUnpack

func (morton *Morton64) SUnpack(code int64) []int64

func (*Morton64) Unpack

func (morton *Morton64) Unpack(code int64) []uint64

Jump to

Keyboard shortcuts

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