rotation-matrix4 ( axis theta -- matrix )


Vocabulary
math.matrices

Definition
USING: arrays locals math math.functions sequences ;

IN: math.matrices

:: rotation-matrix4 ( axis theta -- matrix )
theta cos :> c theta sin :> s axis first3 :> ( x y z ) x sq
1.0 x sq - c * + x y * 1.0 c - * z s * - x z * 1.0 c - *
y s * + 0 4array x y * 1.0 c - * z s * + y sq 1.0 y sq -
c * + y z * 1.0 c - * x s * - 0 4array x z * 1.0 c - *
y s * - y z * 1.0 c - * x s * + z sq 1.0 ~10 more~ ;