こっちだと複雑な式になってるけど、こっちのが正しい?
http://senkei.nomaki.jp/rotation_matrix.html

https://i.imgur.com/qtZVQym.jpg