當前位置:編程學習大全網 - 編程軟體 - 墨卡托投影C++編程

墨卡托投影C++編程

我用的是C語言,希望對妳有所幫助,程序如下:

#include<stdio.h>

#include<math.h>

int main()

{

float U,r0,e=0.081813334,a=6378245,x,y,r,u,p,t=3.1415926,g,h,l,x1,y1,N0;

float B,B0=30.0,L,L0=120.0;

for(B=10.0;B<=50.0;B=B+10.0)

for(L=100.0;L<=140.0;L=L+10.0)

{

h=e/2;

g=(1-e*sin(B/180*t))/(1+e*sin(B/180*t));

U=tan(t/4+(B/180*t)/2)*pow(g,h);

l=(L-L0)/180*t;

r=(a*cos(B/180*t))/(sqrt(1-e*e*sin(B/180*t)*sin(B/180*t)));

r0=(a*cos(B0/180*t))/(sqrt(1-e*e*sin(B0/180*t)*sin(B0/180*t)));

y=r0*l;

x=r0*log(U);

u=r0/r;

p=u*u;

x1=0.00001*x;

y1=0.00001*y;

printf("B=%2.0f\nL=%3.0f\nx1=%f\ty1=%f\t u=%f\t p=%f\n\n\n",B,L,x1,y1,u,p);

}

return 0;

}

  • 上一篇:C語言中int i的I代表什麽?
  • 下一篇:vb裏的xn函數怎麽用啊
  • copyright 2024編程學習大全網