Comments (2)
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.
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)
- rst docs on pypi HOT 4
- Some code verification HOT 1
- A question for coordinates HOT 1
- Include LICENSE in published source distribution HOT 3
- Feature request: numpy array compatibility HOT 7
- Version installed with "pip install hilbertcurve" is out of date HOT 3
- Random sampling methods
- 'HilbertCurve' object has no attribute 'coordinates_from_distance' HOT 1
- Documentation is outdated HOT 1
- I translated your code to C# HOT 2
- distance_from_coordinates method modifies value of input variable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hilbertcurve.