Options
All
  • Public
  • Public/Protected
  • All
Menu

@thi.ng/morton

@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

Generated using TypeDoc