% this Matlab Program is to transformation Different Coordinate Systems
% To use this Program you may copy all this lines and paste in matlab Editor
% Please note that you must have Heading, Pitch and Roll Data's
% This Program is just for Acoustic Doppler measurement devices
======================================================
T =[ 2896 2896 0 ;-2896 2896 0 ;-2896 -2896 5792];
T_scale=T/4096;
T_org=T;
% Output change
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% !!!!!Hier you have to replace a,b,c with required sizes!!!!!
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hh = pi*(a-90)/180; %a ist Heading
pp = pi*b/180; %b ist Pitch
rr = pi*c/180; %c ist roll
% Heading
H = [cos(hh) sin(hh) 0; -sin(hh) cos(hh) 0; 0 0 1];
% Tilt
P = [cos(pp) -sin(pp)*sin(rr) -cos(rr)*sin(pp) ;
0 cos(rr) -sin(rr) ;
sin(pp) sin(rr)*cos(pp) cos(pp)*cos(rr)];
% Transformation Matrix
R = H*P*T;
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% Hier change the required size to configure the formel
% and eliminate the "%" symbol to run
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%enu1 = R*[;0 0 0;0 0 0]; %Given vektor is "beam"
%enu2=???
%==========================================================================
%beam1 = inv(R)*[;0 0 0;0 0 0]; %Given vektor is "enu"
%beam2 = inv(T_org)*[;0 0 0;0 0 0]; %Given vektor is "xyz"
%=======================================================
%xyz1 = T_org*[;0 0 0;0 0 0]; %Given vektor is "beam"
%xyz2 = T_org*inv(R)*[1 1 1;0 0 0;0 0 0]; %Given vektor is "enu"
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% eliminate the "%" symbol to see the results
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%R
%enu1
%enu2
%beam1%beam2%xyz1%xyz2
% To use this Program you may copy all this lines and paste in matlab Editor
% Please note that you must have Heading, Pitch and Roll Data's
% This Program is just for Acoustic Doppler measurement devices
======================================================
T =[ 2896 2896 0 ;-2896 2896 0 ;-2896 -2896 5792];
T_scale=T/4096;
T_org=T;
% Output change
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% !!!!!Hier you have to replace a,b,c with required sizes!!!!!
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hh = pi*(a-90)/180; %a ist Heading
pp = pi*b/180; %b ist Pitch
rr = pi*c/180; %c ist roll
% Heading
H = [cos(hh) sin(hh) 0; -sin(hh) cos(hh) 0; 0 0 1];
% Tilt
P = [cos(pp) -sin(pp)*sin(rr) -cos(rr)*sin(pp) ;
0 cos(rr) -sin(rr) ;
sin(pp) sin(rr)*cos(pp) cos(pp)*cos(rr)];
% Transformation Matrix
R = H*P*T;
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% Hier change the required size to configure the formel
% and eliminate the "%" symbol to run
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%enu1 = R*[;0 0 0;0 0 0]; %Given vektor is "beam"
%enu2=???
%==========================================================================
%beam1 = inv(R)*[;0 0 0;0 0 0]; %Given vektor is "enu"
%beam2 = inv(T_org)*[;0 0 0;0 0 0]; %Given vektor is "xyz"
%=======================================================
%xyz1 = T_org*[;0 0 0;0 0 0]; %Given vektor is "beam"
%xyz2 = T_org*inv(R)*[1 1 1;0 0 0;0 0 0]; %Given vektor is "enu"
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
% eliminate the "%" symbol to see the results
%||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%R
%enu1
%enu2
%beam1%beam2%xyz1%xyz2