#NEWLINE# def quattransformv( q , v ) : #NEWLINE# #INDENT# ( qx , qy , qz , qw ) = q #NEWLINE# qimaginary = ( qx , qy , qz ) #NEWLINE# s = ( ( qw * qw ) - v3dot ( qimaginary , qimaginary ) ) #NEWLINE# r = v3muls ( v , s ) #NEWLINE# s = v3dot ( qimaginary , v ) #NEWLINE# r = v3add ( qw , v3muls ( qimaginary , ( s + s ) ) ) #NEWLINE# r = v3add ( r , v3muls ( v3cross ( qimaginary , v ) , ( qw + qw ) ) ) #NEWLINE# return r