v_rotqr2eu

PURPOSE ^

V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles

SYNOPSIS ^

function e=v_rotqr2eu(m,q)

DESCRIPTION ^

V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles
 Inputs: 
     M        a string of n characters from the set determining the order of rotation axes
              as listed below. Note that the control characters 'rdoOaA' may occur anywhere in the string:
                'x','y','z'    rotate around the given axis by the corresponding angle
                               given in e()
                '1','2','3'    90 degree rotation around x,y or z axis; doesn't use a value from e()
                '4','5','6'    180 degree rotation around x,y or z axis; doesn't use a value from e()
                '7','8','9'    270 degree rotation around x,y or z axis; doesn't use a value from e()
                'r','d'        all angles are given in radians or degrees  [default='r']
                'R','D'        all angles are given in radians or degrees and are negated
             'o','O','a','A'   selects whether to rotate the object or the coordinate axes and
                               whether the rotation axes remain fixed in space for consecutive
                               rotations (extrinsic) or else move with each rotation (intrinsic).
                                  'o' = object-extrinsic [default]
                                  'O' = object-intrinsic
                                  'a' = axes-extrinsic
                                  'A' = axes-intrinsic

     Q(4,...) array of quaternions

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function e=v_rotqr2eu(m,q)
0002 %V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles
0003 % Inputs:
0004 %     M        a string of n characters from the set determining the order of rotation axes
0005 %              as listed below. Note that the control characters 'rdoOaA' may occur anywhere in the string:
0006 %                'x','y','z'    rotate around the given axis by the corresponding angle
0007 %                               given in e()
0008 %                '1','2','3'    90 degree rotation around x,y or z axis; doesn't use a value from e()
0009 %                '4','5','6'    180 degree rotation around x,y or z axis; doesn't use a value from e()
0010 %                '7','8','9'    270 degree rotation around x,y or z axis; doesn't use a value from e()
0011 %                'r','d'        all angles are given in radians or degrees  [default='r']
0012 %                'R','D'        all angles are given in radians or degrees and are negated
0013 %             'o','O','a','A'   selects whether to rotate the object or the coordinate axes and
0014 %                               whether the rotation axes remain fixed in space for consecutive
0015 %                               rotations (extrinsic) or else move with each rotation (intrinsic).
0016 %                                  'o' = object-extrinsic [default]
0017 %                                  'O' = object-intrinsic
0018 %                                  'a' = axes-extrinsic
0019 %                                  'A' = axes-intrinsic
0020 %
0021 %     Q(4,...) array of quaternions
0022 
0023 %
0024 % Outputs:
0025 %
0026 %     E(K,...)  K Euler angles in radians (or degrees if 'd' or 'D' specified) per quaternion where K is the number of 'xyz' characters in M.
0027 %               A positive rotation is clockwise if looking along the +ve axis away from the origin or anti-clockwise if 'R' or 'D' is given.
0028 %               The x, y, z axes form a right-handed triple.
0029 %
0030 % The string M specifies the seqeunce of axes about which the rotations are performed. There are 12
0031 % possible 3-character sequences that avoid consecutive repetitions. These are 'Euler angles' if
0032 % there is a repeated axis or 'Tait-Bryan angles' if not. Common choices are:
0033 % (1) 'zxz' the most common Euler angle set
0034 % (2) 'xyz' corresponds to 'roll, pitch, yaw' for an aeroplane heading in the x direction with y to
0035 %     the right and z down. The intrinsic equivalent is 'Ozyx' corresponding to 'yaw, pitch, roll'.
0036 % (3) 'z1z1z' involves 5 rotations, in which all the non-fixed rotations are around the z axis.
0037 %
0038 % The Euler angles are not, in general, unique. In particular:
0039 %  (1) v_roteu2ro('zxz',[a b c]) = v_roteu2ro('zxz',[a+pi -b c+pi])
0040 %  (2) v_roteu2ro('xyz',[a b c]) = v_roteu2ro('xyz',[a+pi pi-b c+pi])
0041 
0042 %
0043 %      Copyright (C) Mike Brookes 2007-2020
0044 %      Version: $Id: v_rotqr2eu.m 11260 2020-07-18 20:07:58Z dmb $
0045 %
0046 %   VOICEBOX is a MATLAB toolbox for speech processing.
0047 %   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
0048 %
0049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0050 %   This program is free software; you can redistribute it and/or modify
0051 %   it under the terms of the GNU General Public License as published by
0052 %   the Free Software Foundation; either version 2 of the License, or
0053 %   (at your option) any later version.
0054 %
0055 %   This program is distributed in the hope that it will be useful,
0056 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0057 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0058 %   GNU General Public License for more details.
0059 %
0060 %   You can obtain a copy of the GNU General Public License from
0061 %   http://www.gnu.org/copyleft/gpl.html or by writing to
0062 %   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0064 
0065 if nargout
0066     e=v_rotro2eu(m,v_rotqr2ro(q));
0067 else
0068    v_rotqr2ro(q); % draw a cube
0069 end

Generated by m2html © 2003