views:

141

answers:

2

I have a N-dimensional vector, X and 'n' equidistant points along each dimension and a parameter 'delta'. I need a way to find the total of n^N vectors enclosed by the Hypercube defined with the vector X at the center and each side of Hypercube being of size 2*delta.

For example:

Consider a case of N=3, so we have a Cube of size (2*delta) enclosing the point X.

------------\
|\--------|--\
| |   X   |  |
-----------  |
\ |_2*del___\|

Along each dimension I have 'n' points. So, I have a total of n^3 vectors around X. I need to find all the vectors. Is there any standard algorithm/method for the same? If you have done anything similar, please suggest.

If the problem is not clear, let me know.

This is what I was looking at: Considering one dimension, length of a side is 2*delta and I have n divisions. So, each sub-division is of size (2*delta/n). So I just move to the origin that is (x-delta) (since x is the mid point of the side) and obtain the 'n' points by {(x-delta) + 1*(2*delta/n),(x-delta) + 2*(2*delta/n)....+ (x-delta) + 1*(n*delta/n) } . I do this for all the N-dimensions and then take a permutation of the co-ordinates. That way I have all the points.

(I would like to close this)

A: 
Jacob
Thanks :) I was just confused about my requirements and simply asked a very complex question!
Amit
So this is what you were looking for?
Jacob
+1  A: 

If i understand your problem correctly, you have an axis-aligned hypercube centred around a point X, and you have subdivided the interior of this hypercube into a regular lattice where the lattice points and spacing are in the coordinate system of the hypercube. All you have to do is let X = 0, find the vectors to each of the lattice points, and then go back and translate them by X.

Edit: let me add an example

let x = (5,5,5), delta = 1 and n = 3

then, moving x to the origin, your lattice points are (-1, -1, -1), (0, -1, -1), (1, -1, -1) and so on for a total of 27. translating back, we have (4, 4, 4), (5, 4, 4), (6, 4, 4) and so on.

Martin DeMello