ocssw
V2022
|
vincenty.c
Go to the documentation of this file.
70 sin_sigma = sqrt(pow(cos_U2 * sin_lambda, 2) + pow(cos_U1 * sin_U2 - sin_U1 * cos_U2 * cos_lambda, 2));
80 lambda = L + (1 - C) * flattening * sin_alpha * (sigma + C * sin_sigma * (cos_2sigmam + C * cos_sigma * (-1 + 2 * cos_2sigmam)));
88 const double delta_sigma = B * sin_sigma * (cos_2sigmam + 1 / 4 * B * (-1 + 2 * cos2_2sigmam) - 1 / 6 * B * cos_2sigmam * (-3 + 4 * pow(sin_sigma, 2)) * (-3 + 4 * cos2_2sigmam));
91 // I think this stuff calculates the bearings, not required for this function but useful for a geolib.
95 // const double alpha1 = atan((cos_U2 * sin_lambda) / (cosU1_sin_U2 - (sin_U1 * cos_U2 * cos_lambda)));
96 // const double alpha2 = atan((cos_U1 * sin_lambda) / ((-sin_U1 * cos_U2) - (cosU1_sin_U2 * cos_lambda)));
#define VINCENTY_MAX_LOOP
Used to prevent infinite loops caused by non-convergence.
Definition: vincenty.c:12
const double C
#define VINCENTY_TOLERANCE
Used to control the accuracy requirement. 1e−12 corresponds to approximately 0.06mm.
Definition: vincenty.c:7
double vincenty_distance(double lat1, double lon1, double lat2, double lon2)
Calculate geographical distances using Vincenty's algorithm.
Definition: vincenty.c:47