# Using Rotation Matrix Data Applied to a Cube: Visualization

I've written a program that calculates the rotation matrices of a cube over time. The program outputs the matrices to a data file in the form of a series of Mathematica styled matrices (i.e. {{a11,a12,a13},...}}). They are separated by line breaks.

Here is my plan:

~Write a function that associates each matrix to some time t, sequentially.

~Write a function that multiplies a cube with center at origin by the current matrix in accordance with t.

~Write a final function that take output from the previous and visualizes it with a nice 'play' button.

This is my plan, but I'm not sure how to implement it -- I'm pretty new to Mathematica. I took a nice little tutorial, but it didn't cover quite something like this. I could use some help figuring this one out!

Thank you!

• A simple example would be helpful. Don't post the entire data, but include a couple of time-slices, ideally with a smaller number of data points if the slices are actually huge. In addition, provide data for the cube (again ideally a small example). – march Jan 27 '17 at 19:29
• One important detail is missing from the Q: are the times equally spaced? I just assumed they are in order to give an answer that could get you started. If not, interpolation may be an option. – Jens Jan 27 '17 at 19:47
• Storing rotations as full matrices isn't very efficient... why not store just x? Anyway, you just have to replace matrixList in my answer by your list. – Jens Jan 27 '17 at 19:51
• @Jens, at least the matrices are of certain structure here; at worst, one will still only need to store axis+angle… – J. M. will be back soon Jan 27 '17 at 19:59
• If you want to reduce the matrices to the axis-angle information for more efficient storage, you may want to look at my answer here. – Jens Jan 27 '17 at 22:30

I am guessing you're looking for something like this:

matrixList =
Table[EulerMatrix[{0, Pi t/2, 0}], {t, 0, 1, .1}];

frames = Table[
Graphics3D[
GeometricTransformation[Cuboid[{-1, -1, -1}, {1, 1, 1}],
rotation], Boxed -> False, Lighting -> "Neutral",
PlotRange -> 1.5 {{-1, 1}, {-1, 1}, {-1, 1}}], {rotation,
matrixList}];

ListAnimate[frames]

• …and the OP can use RollPitchYawMatrix[] instead if he so wishes… – J. M. will be back soon Jan 27 '17 at 19:34
• @J.M. Or solve Euler's equations etc... I assumed the matrices already exist. – Jens Jan 27 '17 at 19:36