MATLAB程序北京54转换为WGS84坐标(GPS)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
%北京54转换为WGS84坐标(GPS)
%X=3459174.0300 Y=36503163.4500
X=3459181.0255; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%输入X值
Y=36503206.2860; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%输入X值
x=X;
y=Y-fix(Y/1000000)*1000000-500000;
b=x*3600*180/pi/6367558.4969;
T=(cos(b*pi/180/3600))^2;
Bf=b+(50221746+(293622+(2350+22*T)*T)*T)*sin(b*pi/180/3600)*cos(b*pi/180/3600)*3600* 180/pi/10^10;
Q=(cos(Bf*pi/180/3600))^2;
Nf=6399698.902-[21562.267-(108.973-0.612*Q)*Q]*Q;
Z=y/(Nf*cos(Bf*pi/180/3600));
b2=(0.5+0.003369*Q)*sin(Bf*pi/180/3600)*cos(Bf*pi/180/3600);
b3=0.333333-(0.166667-0.001123*Q)*Q;
b4=0.25+(0.16161+0.00562*Q)*Q;
b5=0.2-(0.1667-0.0088*Q)*Q;
B=Bf-[1-(b4-0.12*Z^2)*Z^2]*Z^2*b2*180*3600/pi;
L=[1-(b3-b5*Z^2)*Z^2]*Z*180*3600/pi;
B1=fix(B/3600);
B2=fix((B-B1*3600)/60);
B3=B-B1*3600-B2*60;
L1=fix(L/3600);
L2=fix((L-L1*3600)/60);
L3=L-L1*3600-L2*60;
L4=fix(Y/1000000)*3+L1;
fprintf('\n\n')
fprintf('p点的WGS84坐标:%f\t%f\t%f\t\n',B1,B2,B3)
fprintf('p点的WGS84坐标:%f\t%f\t%f\t\n',L4,L2,L3)