%A_ is the rotating matrix of the reference frame
function [A_]=reference_rotate(theta_,fai_)
A_=[cos(theta_),0,-sin(theta_);0,1,0; sin(theta_),0,cos(theta_)] *...
    [cos(fai_),sin(fai_),0; -sin(fai_),cos(fai_),0; 0, 0,1];
end