32 double t1, t2, t3, t4, t1r, t2r;
53 st->boa = sqrt(1 - e2);
55 st->ff64 = st->f * st->f / 64;
71 st->t1r = atan(st->boa * tan(
Radians(lat1)));
85 double stm, ctm, sdtm, cdtm;
88 st->t2r = atan(st->boa * tan(
Radians(lat2)));
90 tm = (st->t1r + st->t2r) / 2;
91 dtm = (st->t2r - st->t1r) / 2;
99 st->t1 = st->t1 * st->t1 * 2;
102 st->t2 = st->t2 * st->t2 * 2;
104 st->t3 = sdtm * sdtm;
105 st->t4 = cdtm * cdtm - stm * stm;
124 q, sd, sdlmr,
t, u, v,
x, y;
127 sdlmr = sin(
Radians(lon2 - lon1) / 2);
130 if (sdlmr == 0.0 && st->t1r == st->t2r)
133 q = st->t3 + sdlmr * sdlmr * st->t4;
137 return M_PI * st->al;
159 sd = 2 * sqrt(q - q * q);
160 if (q != 0.0 && cd == 1.0)
168 u = st->t1 / (1 - q);
176 return st->al * sd * (t
177 - st->f / 4 * (t * x - y)
178 + st->ff64 * (x * (a + (t - (a + e) / 2) *
x)
179 + y * (-2 * d + e * y) + d * x * y));
double G_geodesic_distance_lon_to_lon(double lon1, double lon2)
Calculates geodesic distance.
void G_begin_geodesic_distance(double a, double e2)
Begin geodesic distance.
void G_set_geodesic_distance_lat2(double lat2)
Sets geodesic distance lat2.
double G_geodesic_distance(double lon1, double lat1, double lon2, double lat2)
Calculates geodesic distance.
void G_set_geodesic_distance_lat1(double lat1)
Sets geodesic distance lat1.