📄 reorder.m
字号:
function [A,B,P]=reorder(A,B,P,k)
% 本函数的作用是调整ABP三点的顺序,判断的依据是方向观测值或方位角。
% 说明:K是控制参数,当k=1时,AB为已知点,P为未知点,A为测站,对ABP三点按逆指针顺序排列,用于前方交会;
% 当k=2时,AB为已知点,P为未知点,P为测站,对ABP三点按逆指针顺序排列,用于前方交会;
% 当k=3时,ABP三点均为已知点,且按顺时针排列,用于后方交会。
% k为1,2的区别为:前者测站为已知点,可参与换位,后者测站为未知点,不能参与换位
global f g dir x0 y0
if k==1 %%%------>方向观测起点为已知点,排成逆时针方向
temp1=find(g==A&f==B);
dirAB=dir(temp1);
temp2=find(g==A&f==P);
dirAP=dir(temp2);
gama=dirAB-dirAP;
if gama<0
gama=gama+2*pi;
end
if gama>pi
temp=A;A=B;B=temp;
end
elseif k==2
temp1=find(g==P&f==A);
dirPA=dir(temp1);
temp2=find(g==P&f==B);
dirPB=dir(temp2);
gama=dirPA-dirPB;
if gama<0
gama=gama+2*pi;
end
if gama>pi
temp=A;A=B;B=temp;
end +
elseif k==3 %%%---------〉A,B,P三点均为已知点,排成顺时针方向
deltx1=x0(B)-x0(A);delty1=y0(B)-y0(A);
deltx2=x0(P)-x0(A);delty2=y0(P)-y0(A);
alfaAB=alfa(deltx1,delty1);
alfaAC=alfa(deltx2,delty2);
bet=alfaAC-alfaAB;
if bet<0
bet=bet+2*pi;
end
if bet>pi
temp=A;A=B;B=temp;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -