rotation-matrix4 ( axis: float-4 theta: float -- matrix: matrix4 )


Vocabulary
math.matrices.simd

Inputs and outputs
axisa float-4
thetaa float
matrixa matrix4


Definition


TYPED:: rotation-matrix4
( axis: float-4 theta: float -- matrix: matrix4 )
theta cos :> c theta sin :> s
float-4{ -1.0 1.0 -1.0 0.0 } :> triangle-sign c float-4-with
:> cc s float-4-with :> ss 1.0 float-4-with :> ones ones cc
v- :> 1-c axis axis v* :> axis2 axis2 cc ones axis2 v- v* v+
:> diagonal axis { 1 0 0 3 } vshuffle axis
{ 2 2 1 3 } vshuffle v* 1-c v* float-4{
NAN: fffffe0000000
NAN: fffffe0000000
NAN: fffffe0000000
0.0
} vbitand :> triangle-a ss axis v* triangle-sign v*
:> triangle-b triangle-a triangle-b v+
:> triangle-lo triangle-a triangle-b v-
:> triangle-hi diagonal triangle-hi triangle-lo
(rotation-matrix4) ;