PLUS Add two quaternion objects Invoked by the + operator q1+q2 standard quaternion addition
0001 %PLUS Add two quaternion objects 0002 % 0003 % Invoked by the + operator 0004 % 0005 % q1+q2 standard quaternion addition 0006 0007 % Copyright (C) 1999-2008, by Peter I. Corke 0008 % 0009 % This file is part of The Robotics Toolbox for Matlab (RTB). 0010 % 0011 % RTB is free software: you can redistribute it and/or modify 0012 % it under the terms of the GNU Lesser General Public License as published by 0013 % the Free Software Foundation, either version 3 of the License, or 0014 % (at your option) any later version. 0015 % 0016 % RTB is distributed in the hope that it will be useful, 0017 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0019 % GNU Lesser General Public License for more details. 0020 % 0021 % You should have received a copy of the GNU Leser General Public License 0022 % along with RTB. If not, see <http://www.gnu.org/licenses/>. 0023 0024 function qp = plus(q1, q2) 0025 0026 if isa(q1, 'quaternion') & isa(q2, 'quaternion') 0027 0028 qp = quaternion(double(q1) + double(q2)); 0029 end