I finally had a chance to play with this again today and realized that somehow I had completely scrambled the order of the returned array (no idea how I screwed that up so badly). I also flipped the direction of my rotor (which explained the negative angle and some of the stupid changes I made to the transformation matrix).
Your code works perfectly enki. After applying a transpose (as kindly pointed out by ninepoints) I am getting a working transform. Here’s the proper version in Python, thank you all again!
#____________________________________________________________________
# M[0], M[5], M[6], M[7], M[8], M[9], M[10], M[15]
# S(1), e01, e02, e03, e12, e31, e23, e0123
#____________________________________________________________________
def TransformationMatrix3D(M):
a0,a1,a2,a3,a4,a5,a6,a7 = M[0],M[5],M[6],M[7],M[9],M[10],M[8],M[15]
_2a0 = 2 * a0
_2a4 = 2 * a4
_2a5 = 2 * a5
a0a0 = a0 * a0
a4a4 = a4 * a4
a5a5 = a5 * a5
a6a6 = a6 * a6
_2a6 = 2 * a6
_2a0a4 = _2a0 * a4
_2a0a5 = _2a0 * a5
_2a0a6 = _2a0 * a6
_2a4a5 = _2a4 * a5
_2a4a6 = _2a4 * a6
_2a5a6 = _2a5 * a6
return [
(a0a0 + a4a4 - a5a5 - a6a6), (_2a4a5 + _2a0a6), (_2a4a6 - _2a0a5), ((_2a0 * a3) + (_2a4 * a7) - (_2a6 * a2) - (_2a5 * a1)),
(_2a4a5 - _2a0a6), (a0a0 - a4a4 + a5a5 - a6a6), (_2a0a4 + _2a5a6), ((_2a4 * a1) - (_2a0 * a2) - (_2a6 * a3) + (_2a5 * a7)),
(_2a0a5 + _2a4a6), (_2a5a6 - _2a0a4), (a0a0 - a4a4 - a5a5 + a6a6),((_2a0 * a1) + (_2a4 * a2) + (_2a5 * a3) + (_2a6 * a7)),
0, 0, 0, (a0a0 + a4a4 + a5a5 + a6a6)
]