 # Rotating Stress Tensors (matrix transformations)

I have been working on an analysis model based on finite elements analysis. I am currently using millipede to do the analysis itself. But working with the outputs is difficult as they are represented as tress tensors.

Stress tensors are 3x3 matrices of the tension, compression, shear formulated as:
[xx, xy, xz]
[yx, yy, yz]
[zx, zy, zz]
These tensors use a reference plane (coordinate system). Millipede is nice enough to produce the principle stress tensor:
[xx, 0, 0]
[0, yy, 0]
[0, 0, zz]
Along with its corresponding reference plane. Combining various results requires them being oriented to the same coordinate system.

Are there tools in grasshopper to transform these principle stress tensors to conform to a different plane of reference (say world) and back?
Mathematically it is simply a matrix transformation but I haven’t found a component/plugin doing this.

RhinoCommon transform matrices are pretty flexible, so if the stress tensor is similar to just the upper-left 3x3 portion of a 4x4 transformation matrix, all you’d have to do is pad it and then you can use methods on `Rhino.Geometry.Transform` to perform change-of-basis operations.