From: Satsou Sa Date: 2012-01-09T06:15:28+09:00 Subject: NArray - from coordinates to index Hi, How can we convert a coordinates to an index? I'm using the awesome NArray library with some arrays of 1, 2, 3, or more dimensions. For instance, if we consider this 3x3 array of 2 dimensions ... NArray.int(3,3): [ [ 0, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ] ... the square of the coordinate [0,1] have also the index of 3 (and according to the NArray specs, a[3] is same as a[0,1] if a is 3x3 array). Is there a simple way to find the index, from the coordinates? Many thanks, Sa- -- Posted via http://www.ruby-forum.com/.