Multi-dimensional Arrays

I know they are not supported and from the Manual it says
“a combination of structs and arrays can be used to simulate multi-dimensional arrays.”
So how would it be done for something like this example from a program I wrote?
Don’t worry about the stuff after the = signs.

rotationMatrix[0][0] = (u2 + (v2 + w2) * cos(angle)) / L;
rotationMatrix[0][1] = (u * v * (1 - cos(angle)) - w * sqrt(L) * sin(angle)) / L;
rotationMatrix[0][2] = (u * w * (1 - cos(angle)) + v * sqrt(L) * sin(angle)) / L;
rotationMatrix[0][3] = 0.0;
rotationMatrix[1][0] = (u * v * (1 - cos(angle)) + w * sqrt(L) * sin(angle)) / L;
rotationMatrix[1][1] = (v2 + (u2 + w2) * cos(angle)) / L;
rotationMatrix[1][2] = (v * w * (1 - cos(angle)) - u * sqrt(L) * sin(angle)) / L;
rotationMatrix[1][3] = 0.0;
rotationMatrix[2][0] = (u * w * (1 - cos(angle)) - v * sqrt(L) * sin(angle)) / L;
rotationMatrix[2][1] = (v * w * (1 - cos(angle)) + u * sqrt(L) * sin(angle)) / L;
rotationMatrix[2][2] = (w2 + (u2 + v2) * cos(angle)) / L;
rotationMatrix[2][3] = 0.0;
rotationMatrix[3][0] = 0.0;
rotationMatrix[3][1] = 0.0;
rotationMatrix[3][2] = 0.0;
rotationMatrix[3][3] = 1.0;

Hello Jeff. If you want to use matrices in 010 Editor you can do something like this:

typedef struct 
{
    float row[4];
} 
MATRIX[4];

Then you can use rotationMatrix[0].row[0] to reference values in the matrix. For example:

local MATRIX rotationMatrix; 
rotationMatrix[0].row[0] = 1;
rotationMatrix[0].row[1] = 2;
rotationMatrix[1].row[0] = 3;
rotationMatrix[1].row[1] = 4;

Let us know if you have any questions. Cheers!

Graeme
SweetScape Software

Thank you very much!
Might want to include that in the Manual for others.