to_q#

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

Synonym of method to_quaternion().

Parameters:

method (str, default: 'shepperd') – 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.34241004, -0.67294223,  0.65567074],
     [-0.22200526, -0.62014526, -0.75241845],
     [ 0.91294525, -0.40319798,  0.06294725]])
>>> R.to_q()   # Uses method 'shepperd' by default
array([ 0.15842345,  0.5510871 , -0.40599185,  0.71160076])
>>> R.to_q('shepperd')
array([ 0.15842345,  0.5510871 , -0.40599185,  0.71160076])
>>> R.to_q('hughes')
array([ 0.15842345,  0.5510871 , -0.40599185,  0.71160076])
>>> R.to_q('itzhack', version=2)
array([ 0.15842345,  0.5510871 , -0.40599185,  0.71160076])
>>> R.to_q('sarabandi', threshold=0.5)
array([0.15842345, 0.5510871 , 0.40599185, 0.71160076])