When dealing with an element that has a transformation like the following:
style="transform: rotate3d(1, 0, 0, -50deg);"
I am looking to extract the value -50
using Javascript or jQuery.
It's essential for me to get the absolute value, so negative degrees should be avoided.
Attempting to use $('#element').css('transform')
produces a matrix representation:
matrix3d(1, 0, 0, 0, 0, 0.642788, -0.766044, 0, 0, 0.766044, 0.642788, 0, 0, 0, 0, 1)
This matrix can also be shown in this format:
matrix3d(
1, 0, 0, 0,
0, 0.642788, -0.766044, 0,
0, 0.766044, 0.642788, 0,
0, 0, 0, 1
)
Is solving the equations the only solution?
https://i.sstatic.net/B5n9T.png
Given that Z =0 and X =1 as indicated by rotate3d(1, 0, 0, -50deg);
https://i.sstatic.net/WWJVs.png
Are there any quicker alternatives available for this problem?