# v_rotqrvec

## PURPOSE

V_ROTQRVEC applies a quaternion rotation ot a vector array y=[q,x]

## SYNOPSIS

function y=v_rotqrvec(q,x)

## DESCRIPTION

```V_ROTQRVEC applies a quaternion rotation ot a vector array y=[q,x]

Inputs:   q(4,1)    quaternion rotation (possibly unnormalized)
x(3n,...) array of 3D column vectors

Outputs:  y(3n,...) array of 3D column vectors```

## CROSS-REFERENCE INFORMATION

This function calls:
• v_rotqr2ro ROTQR2RO converts a real quaternion to a 3x3 rotation matrix
This function is called by:

## SOURCE CODE

```0001 function y=v_rotqrvec(q,x)
0002 %V_ROTQRVEC applies a quaternion rotation ot a vector array y=[q,x]
0003 %
0004 % Inputs:   q(4,1)    quaternion rotation (possibly unnormalized)
0005 %           x(3n,...) array of 3D column vectors
0006 %
0007 % Outputs:  y(3n,...) array of 3D column vectors
0008
0009 %      Copyright (C) Mike Brookes 2011-2012
0010 %      Version: \$Id: v_rotqrvec.m 10865 2018-09-21 17:22:45Z dmb \$
0011 %
0012 %   VOICEBOX is a MATLAB toolbox for speech processing.
0014 %
0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0016 %   This program is free software; you can redistribute it and/or modify
0018 %   the Free Software Foundation; either version 2 of the License, or
0019 %   (at your option) any later version.
0020 %
0021 %   This program is distributed in the hope that it will be useful,
0022 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0023 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0024 %   GNU General Public License for more details.
0025 %
0026 %   You can obtain a copy of the GNU General Public License from
0027 %   http://www.gnu.org/copyleft/gpl.html or by writing to
0028 %   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0030 s=size(x);
0031 y=reshape(v_rotqr2ro(q)*reshape(x,3,[]),s);```