17 double lat[n+1], lon[n+1], azi[n+1];
21 PJ_CONTEXT* C = proj_context_create();
22 char* argv[3] = {
"type=crs",
"proj=longlat",
"ellps=WGS84"};
23 PJ* P = proj_create_argv(C, 3, argv);
25 fprintf(stderr,
"Failed to create transformation object.\n");
28 proj_ellipsoid_get_parameters(C, proj_get_ellipsoid(C, P),
31 proj_context_destroy(C);
38 printf(
"latitude longitude azimuth\n");
39 for (i = 0; i <= n; ++i) {
42 i * l.
a13 / n, lat + i, lon + i, azi + i, 0, 0, 0, 0, 0);
43 printf(
"%.5f %.5f %.5f\n", lat[i], lon[i], azi[i]);
API for the geodesic routines in C.
void GEOD_DLL geod_init(struct geod_geodesic *g, double a, double f)
double GEOD_DLL geod_genposition(const struct geod_geodesicline *l, unsigned flags, double s12_a12, double *plat2, double *plon2, double *pazi2, double *ps12, double *pm12, double *pM12, double *pM21, double *pS12)
void GEOD_DLL geod_inverseline(struct geod_geodesicline *l, const struct geod_geodesic *g, double lat1, double lon1, double lat2, double lon2, unsigned caps)