This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function R=fcn_RotationFromTwoVectors(A, B) | |
% http://math.stackexchange.com/questions/180418/calculate-rotation-matrix-to-align-vector-a-to-vector-b-in-3d | |
% R*v1=v2 | |
% v1 and v2 should be column vectors and 3x1 | |
%% Method 1 | |
% % 1. rotation vector | |
% w=cross(v1,v2); | |
% w=w/norm(w); | |
% w_hat=fcn_GetSkew(w); |