We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Folding Space (multi-dimensional arrays)
Page Index Toggle Pages: 1
Folding Space (multi-dimensional arrays) (Read 992 times)
Folding Space (multi-dimensional arrays)
Jul 5th, 2006, 4:46pm
 
I asked this as a question in Programs and dropped it but was inspired by "Imagining the Tenth Dimension" to pick it up again. For those of you used to three dimensions or less, the flash movie is a really good beginners guide to 10 dimensions (seriously).

Anyhoo. My question was about taking a length of string (an array) and turning a point on that string into a point in a number of dimensions.

We do this by folding and splitting our piece of string. Moving into the higher dimensions we stack, split and fold time, reality, infinity, etc. When we get a single pixel from the pixels[] array we perform a fold and a split. By stacking the folds and the size of the split we can turn a single dimension into many:
Code:

int [] dim = {
10, 10, 10};

void setup(){
int [] foldy = getFolded(131, dim);
print(foldy);
println();
print(getUnfolded(foldy, dim));
}

int [] getFolded(int n, int [] d){
int [] coord = new int[d.length];
for(int i = 0; i < d.length; i++){
coord[i] = n;
//folding
for(int j = d.length - 1; j > i; j--){
int level = 1;
for(int k = 0; k < j; k++){
level *= d[k];
}
coord[i] %= level;
}
//splitting
int level = 1;
for(int j = 0; j < i; j++){
level *= d[j];
}
coord[i] /= level;
}
return coord;
}

int getUnfolded(int [] p, int [] d){
int coord = 0;
//stacking
for(int i = 0; i < p.length; i++){
int level = 1;
for(int j = 0; j < i; j++){
level *= d[j];
}
coord += p[i] * level;
}
return coord;
}

You need never use massively multi-dimensional arrays again.

Another tack would be to feed in a point in arbitrary dimensions and get it's locus in arbitrary dimensions. A low key route would be to unfold into one dimension and then fold back into the required amount of dimensions.

In writing that statement I've just figured out the algorithm, but I'll post that later.

If anyone has a clue on how to make this work on Floats that would be great news. Particles I imagine could be modelled moving through hyperspace, interacting with forces in higher dimensions.
Re: Folding Space (multi-dimensional arrays)
Reply #1 - Jul 6th, 2006, 5:17pm
 
I like that site - though 10 dimensions is a bit much before breakfast!

Thanks for posting this. You seem to always be working on the craziest stuff. Keep it up....
Page Index Toggle Pages: 1