to_q#

DCM.to_q(method: str = 'chiaverini', **kw) ndarray#

Synonym of method to_quaternion().

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_q()   # Uses method 'chiaverini' by default
array([ 0.94371436,  0.26853582, -0.14487813,  0.12767944])
>>> R.to_q('shepperd')
array([ 0.94371436, -0.26853582,  0.14487813, -0.12767944])
>>> R.to_q('hughes')
array([ 0.94371436, -0.26853582,  0.14487813, -0.12767944])
>>> R.to_q('itzhack', version=2)
array([ 0.94371436, -0.26853582,  0.14487813, -0.12767944])
>>> R.to_q('sarabandi', threshold=0.5)
array([0.94371436, 0.26853582, 0.14487813, 0.12767944])