JSPM

  • Created
  • Published
  • Downloads 527
  • Score
    100M100P100Q98658F
  • License Apache-2.0

Z-order-curve / Morton encoding & decoding for 1D, 2D, 3D

Package Exports

  • @thi.ng/morton

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@thi.ng/morton) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@thi.ng/morton

npm (scoped) npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

Z-order-curve / Morton encoding & decoding for 1D, 2D, 3D.

Installation

yarn add @thi.ng/morton

Dependencies

Usage examples

import * as m from "@thi.ng/morton";

m.mux2(23, 42);
// 2461

m.demux2(2461)
// [ 23, 42 ]

m.muxScaled2(0.25, 0.75)
// 2594876074

m.demuxScaled2(m.muxScaled2(0.25, 0.75))
// [ 0.2500038147554742, 0.7499961852445258 ]

Authors

  • Karsten Schmidt

License

© 2015 - 2018 Karsten Schmidt // Apache Software License 2.0