Giter VIP home page Giter VIP logo

Comments (2)

galtay avatar galtay commented on August 23, 2024

Thanks for raising the issue @Toast-b ! Yea, I could have done better with the description. If we concentrate on the image in the README.rst (https://github.com/galtay/hilbertcurve/blob/develop/n2_p3.png) and examine the n=2, p=3 curve (the black hilbert curve) then we have z = 2^(n * p) = 2^(3*2) = 2^6 = 64. The points on the black line are labeled 0 to 63 which is what I meant by "the distances are indexed from 0 to 2^(N p) - 1". If we consider each labeled point along the curve to be the center of a unit hypercube then we also have a side length of 2^p = 2^3 = 8 for the total hypercube (i.e. square with n=2). This is not the same (as you point out) as the straight line distance from (x_0=0, x_1=0) to (x_0=7, x_1=0) which is 2^p - 1 = 7. I think the visualization might be improved by shifting it a half unit forward in each dimension so that the grid lines coincide with the unit hypercube boundaries (although then the coordinates of each labeled point would be half-integers). I'll think about it and update ... maybe just adding hypercube boundaries in a light color would help more. :)

from hilbertcurve.

Toast-b avatar Toast-b commented on August 23, 2024

Indeed, I was off-by-one with the indexing, I was thinking hastily.

With the cube size, what you say makes complete sense, it makes sense to "embed" the nodes in the unit cubes. What I was doing, I wanted to scale the cube to have have "physical" size one unit cubed. Then I realized I have to scale with 1/(2^p - 1) and not with the formula in the readme. It wasn't what I expected. :)

from hilbertcurve.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.