ut552 - Initialize a quaternion rotation matrix¶
- subroutine ut552(quat, ktrl, trans)¶
- Parameters:
quat (4) [real8,in] :: Quaternion
ktrl [integer4,in] :: Control parameter
trans (3,3) [real8,in/out] :: Matrix transformation
Description¶
The subroutine
ut552()
initializes or modifies the coordinate transformation with the help of a normalized quaternion. A quaternion is a four-element vector that generalizes the complex number and which can be used to represent a rotation in a three dimensional space. Note that, for normalized quaternion, q12 + q22 + q32 + q42 has to be equal to one. The normalized quaternion rewritten as (u sin(theta), v sin(theta), w sin(theta), cos(theta)) represents a rotation by an angle theta around the axis (u, v, w).The argument
ktrl
controls the way the rotation matrix trans is produced. When ktrl is equal to zero the Euler rotation matrix is copied into the argumenttrans
; otherwise, the Euler rotation matrix is combined with the rotation matrix already stored in argumenttrans
. When the value of argumentktrl
is negative, the Euler rotation is applied before the rotation stored in argumenttrans
. When the value is positive, the Euler rotation is applied after the stored rotation. The argumentktrl
allows thus to easily combine the functionalities of subroutinesut550()
,ut551()
andut552()
.
History¶
The subroutine UT552 does not exist in version 1.07 and earlier.
Diagnostics¶
None
Common Blocks¶
None
Dependencies¶
Called by¶
None
Calls¶
None
See also¶
Reported Bugs¶
None
Examples¶
None
UNILIB/tags/v3.02