Home > General-Functions > Geometry > calc_Rot_ab.m

calc_Rot_ab

PURPOSE ^

% minimum Rotation matrix from vector a to vector b

SYNOPSIS ^

function R = calc_Rot_ab(a,b)

DESCRIPTION ^

% minimum Rotation matrix from vector a to vector b
 see PCV (8.76)

 Usage:
   R = calc_Rot_ab(a,b)
 
   a,b - double DX1, pair of noncoplanar vectors
   R - double DxD, rotation matrix

 Wolfgang Förstner 1/2011
 wfoerstn@uni-bonn.de 

 See also calc_R_from_opq_kraus, calc_opq_from_R_Kraus, calc_Rot_q,
 calc_Rot_r, calc_Rot_rod, calc_Rot_rp, calc_Mq, calc_Mq_comm, calc_r_phi_from_R

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% minimum Rotation matrix from vector a to vector b
0002 % see PCV (8.76)
0003 %
0004 % Usage:
0005 %   R = calc_Rot_ab(a,b)
0006 %
0007 %   a,b - double DX1, pair of noncoplanar vectors
0008 %   R - double DxD, rotation matrix
0009 %
0010 % Wolfgang Förstner 1/2011
0011 % wfoerstn@uni-bonn.de
0012 %
0013 % See also calc_R_from_opq_kraus, calc_opq_from_R_Kraus, calc_Rot_q,
0014 % calc_Rot_r, calc_Rot_rod, calc_Rot_rp, calc_Mq, calc_Mq_comm, calc_r_phi_from_R
0015 
0016 function R = calc_Rot_ab(a,b)
0017 
0018 as = a/norm(a);
0019 bs = b/norm(b);
0020 
0021 R = eye(length(a))+2*bs*as'-(as+bs)*(as+bs)'/(1+as'*bs);

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005