Welcome Guest. Please Login or Register. Apr 1st, 2018, 03:46am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
As I was going to St. Ives...
« Thread started on: Nov 12th, 2016, 9:04pm »
I was trying to visualize an array with more than two dimensions and I thought of the Nursery rhyme: dim one: wives/folders dim two: sacks/files dim three cats/records dim four kittens/fields
Does anyone have a demo of using an array with more than 3 dimensions that is more practical than this?
I'm guessing that multidimensional arrays might be used in higher math.
Does anyone have a demo of using an array with more than 3 dimensions that is more practical than this?
More than 3 or more than 2? You refer to both options in the question.
I don't know whether it's helpful, but in Bluatigro's recently posted CG animation thread he ideally needs a 3D array, but has simulated it using a 2D array - which is one reason why the program runs so slowly. He has a set of 3D objects, each of which has a position/size/orientation represented by a 4x4 matrix. So altogether it's an array of 2-dimensional arrays, i.e. a 3D array.
Another example would be to use a 3D array to describe the red, green and blue components of an image. The first index might correspond to the x-coordinate, the second index to the y-coordinate and the third index might contain the value 1, 2 or 3 (for R, G and B) to indicate which color component is stored.
You could extend this idea to a 4D array containing a set of 2D images. The first index would be the image number, the second and third indices the x&y coordinates and the fourth index the color component.