может быть так:
gg + min / 60 + sec / 3600
Posted via RSDN NNTP Server 2.0
Здравствуйте, __den, Вы писали:
__>Да, я еще забыл написать что я пробовал делать:
__>gg;min;sec -> gg,minsec как мне казалось наиболее правильным,
__>но это дает очень большую ошибку.
#define DEG2RAD(d) ((d)/57.2957795131)
#define RAD2DEG(r) ((r)*57.2957795131)
double DegreesToMeters(double x1, double y1, double x2, double y2)
{
// H. Andoyer: [Annuaire du Bureau des Longitudes, 1950, Paris, p. 145]
if (x1 == x2 && y1 == y2)
return 0;
double a = 6378137; // Use GRS 80 spheroid
double f = 0.003352813; // 1 / 298.257
double F = (DEG2RAD(y1) + DEG2RAD(y2)) / 2.0;
double G = (DEG2RAD(y1) - DEG2RAD(y2)) / 2.0;
double l = (DEG2RAD(x1) - DEG2RAD(x2)) / 2.0;
double sF2 = pow(sin(F),2);
double cF2 = pow(cos(F),2);
double sG2 = pow(sin(G),2);
double cG2 = pow(cos(G),2);
double sL2 = pow(sin(l),2);
double cL2 = pow(cos(l),2);
double S = sG2*cL2 + cF2*sL2;
double C = cG2*cL2 + sF2*sL2;
double omega = atan(sqrt(S/C));
double rho = sqrt(S*C) / omega;
double D = 2*a*omega;
double H1 = (3*rho - 1) / (2*C);
double H2 = (3*rho + 1) / (2*S);
return D*(1 + f*(H1*sF2*cG2 - H2*cF2*sG2)); //meters
}