to_quaternion#
- DCM.to_quaternion(method: str = 'chiaverini', **kw) ndarray #
Quaternion from Direction Cosine Matrix.
There are five methods available to obtain a quaternion from a Direction Cosine Matrix:
'chiaverini'
as described in [Chiaverini].'hughes'
as described in [Hughes].'itzhack'
as described in [Bar-Itzhack] using version3
by default. Possible options are integers1
,2
or3
.'sarabandi'
as described in [Sarabandi] with a threshold equal to0.0
by default. Possible threshold values are floats between-3.0
and3.0
.'shepperd'
as described in [Shepperd].
- Parameters:
method (str, default:
'chiaverini'
) – Method to use. Options are:'chiaverini'
,'hughes'
,'itzhack'
,'sarabandi'
, and'shepperd'
.
Examples
>>> R = DCM(rpy=[10.0, -20.0, 30.0]) >>> R.view() DCM([[ 0.92541658, -0.31879578, -0.20487413], [ 0.16317591, 0.82317294, -0.54383814], [ 0.34202014, 0.46984631, 0.81379768]]) >>> R.to_quaternion() # Uses method 'chiaverini' by default array([ 0.94371436, 0.26853582, -0.14487813, 0.12767944]) >>> R.to_quaternion('shepperd') array([ 0.94371436, -0.26853582, 0.14487813, -0.12767944]) >>> R.to_quaternion('hughes') array([ 0.94371436, -0.26853582, 0.14487813, -0.12767944]) >>> R.to_quaternion('itzhack', version=2) array([ 0.94371436, -0.26853582, 0.14487813, -0.12767944]) >>> R.to_quaternion('sarabandi', threshold=0.5) array([0.94371436, 0.26853582, 0.14487813, 0.12767944])