NAME
DtMatrixGetQuaternion - Given a 4x4 matrix this routine will
return the quaternion value of the matrix.
SYNOPSIS
#include <Dt.h>
int DtMatrixGetQuaternion( float *matrix, float *scalar, float *xAxis, float *yAxis, float *zAxis )
DESCRIPTION
DtMatrixGetQuaternion() decomposes matrix into its
quaternion describing the orientation. The quaternion is of
the form ( scalar , xAxis , yAxis , zAxis ). The value
scalar represents the cosine of half the rotation angle
counter-clockwise to the rotational axis in a right-handed
coordinate system. The components of the rotational axis are
multiplied by the sine of half the rotation angle and is
stored in xAxis , yAxis , zAxis. The magnitude of the
quaternion should always be 1. To convert this quaternion to
a left-handed system, you should multiply xAxis , yAxis ,
zAxis by negative 1.
DIAGNOSTICS
DtMatrixGetQuaternion() returns one on success and zero on
failure.
SEE ALSO
DtMatrixGetRotation(3W)
FILES
Link with -lDtOMio