From: <jpi...@us...> - 2011-11-07 14:46:24
|
Revision: 9017 http://octave.svn.sourceforge.net/octave/?rev=9017&view=rev Author: jpicarbajal Date: 2011-11-07 14:46:13 +0000 (Mon, 07 Nov 2011) Log Message: ----------- quaternion_oo. Updating port file and adding the vectorized norm method. Modified Paths: -------------- trunk/octave-forge/extra/quaternion_oo/devel/RV9_Quaternions.txt Added Paths: ----------- trunk/octave-forge/extra/quaternion_oo/devel/norm.m Modified: trunk/octave-forge/extra/quaternion_oo/devel/RV9_Quaternions.txt =================================================================== --- trunk/octave-forge/extra/quaternion_oo/devel/RV9_Quaternions.txt 2011-11-07 01:39:25 UTC (rev 9016) +++ trunk/octave-forge/extra/quaternion_oo/devel/RV9_Quaternions.txt 2011-11-07 14:46:13 UTC (rev 9017) @@ -14,6 +14,7 @@ %% along with this program. If not, see <http://www.gnu.org/licenses/>. === Robotics Toolbox Port to Octave === +http://petercorke.com/Robotics_Toolbox.html With the objective of porting the robotics toolbox version 9 to octave forge we list the classes relate to quaternions. @@ -95,8 +96,10 @@ == Quaternion == = methods = -[] inv return inverse of quaterion -[] norm return norm of quaternion +[c] inv return inverse of quaterion +By Monday, November 07 2011 this function is equivalent to the conj function of quaternions_oo + +[*] norm return norm of quaternion [] unit return unit quaternion [] unitize unitize this quaternion [] plot same options as trplot() @@ -105,11 +108,11 @@ [] dot derivative of quaternion with angular velocity w = Operators = -[] q+q2 return elementwise sum of quaternions -[] q-q2 return elementwise difference of quaternions -[] q*q2 return quaternion product -[] q*v rotate vector by quaternion, v is 3x1 -[] q/q2 return q*q2.inv +[*] q+q2 return elementwise sum of quaternions +[*] q-q2 return elementwise difference of quaternions +[*] q*q2 return quaternion product +[*] q*v rotate vector by quaternion, v is 3x1 +[*] q/q2 return q*q2.inv [] q^n return q to power n (integer only) = Properties (read only)= Added: trunk/octave-forge/extra/quaternion_oo/devel/norm.m =================================================================== --- trunk/octave-forge/extra/quaternion_oo/devel/norm.m (rev 0) +++ trunk/octave-forge/extra/quaternion_oo/devel/norm.m 2011-11-07 14:46:13 UTC (rev 9017) @@ -0,0 +1,30 @@ +## Copyright (c) 2011 Juan Pablo Carbajal <car...@if...> +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{n} = } norm (@var{q}) +## Computes the norm of a quaternion. +## +## The norm of a quaternion is defined as the sum of its squares components. +## @var{q} can be a N-by-4 array representign N quaternions. In that case +## @var{n} is of the same size as @var{q}. +## +## @end deftypefn + +function n = norm (q) + + n = sqrt (sumsq (q,2)); + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |