www.pudn.com > Quaternions-MUSIC.rar > hpc.m, change:2012-12-03,size:502b


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%**程序名字: 四元数的乘法 
%**作者:     李靖 
%**日期:     2004 
%**修改人: 
%**日期: 
%**描述:     实现两个四元数的相乘 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
function y=hpc(a,b) 
 
 
x(1)=a(1)*b(1)-a(2)*b(2)-a(3)*b(3)-a(4)*b(4); 
x(2)=a(1)*b(2)+b(1)*a(2)+a(3)*b(4)-b(3)*a(4); 
x(3)=a(1)*b(3)+b(1)*a(3)+b(2)*a(4)-a(2)*b(4); 
x(4)=a(1)*b(4)+b(1)*a(4)+a(2)*b(3)-b(2)*a(3); 
y = x;