Red de conocimiento informático - Material del sitio web - Programación en C++ de proyección de Mercator

Programación en C++ de proyección de Mercator

Utilizo lenguaje C, espero que te sea de ayuda. El programa es el siguiente:

#include

#include.

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)

para(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.0 f\nx1=%f\ty1=%f\t u=%f\t p=%f\n\n\n",B,L,x1,y1,u,p);

}

devuelve 0;

}