Find the position within an array larger than 3D (New Features)
M...
for 2 D assuming d1 and d0 as the dimensions and a1 and a0 are the array index
the formula i2d = (a1-1) * d0 + (a0-1) would convert to 1D
3d d2, d1, d0 and a2, a1, a0 would be
i3d = (a2-1) * d1 * d0 + (a1-1) * d0 + (a0-1) - or -
i3d = (a2-1) * d1 * d0 + i2d
4d d3, d2, d1, d0 and a3, a2, a1, a0 would be
i4d = (a3-1) * d2 * d1 * d0 + (a2-1) * d1 * d0 + (a1-1) * d0 + (a0-1) - or -
i4d = (a3-1) * d2 * d1 * d0 + i3d
I think this would be a general (recursive) definition (in my own screwy notation.
i{N}d = (a{N-1} - 1) * PRODUCT(d{N-2} ... d{0}) + i{n-1}d
Complete thread:
- Find the position within an array larger than 3D -
lrcvs,
2012-05-01, 22:16
- Find the position within an array larger than 3D -
Jim,
2012-05-02, 02:52
- Find the position within an array larger than 3D -
lrcvs,
2012-05-05, 08:39
- Find the position within an array larger than 3D - lrcvs, 2012-05-05, 13:27
- Find the position within an array larger than 3D -
lrcvs,
2012-05-05, 08:39
- Find the position within an array larger than 3D -
Jim,
2012-05-02, 02:52