planimeter.c
Go to the documentation of this file.
1 
6 #include <stdio.h>
7 #include "geodesic.h"
8 
9 #if defined(_MSC_VER)
10 /* Squelch warnings about scanf */
11 # pragma warning (disable: 4996)
12 #endif
13 
23 int main() {
24  double a = 6378137, f = 1/298.257223563; /* WGS84 */
25  double lat, lon, A, P;
26  int n;
27  struct geod_geodesic g;
28  struct geod_polygon p;
29  geod_init(&g, a, f);
30  geod_polygon_init(&p, 0);
31 
32  while (scanf("%lf %lf", &lat, &lon) == 2)
33  geod_polygon_addpoint(&g, &p, lat, lon);
34  n = geod_polygon_compute(&g, &p, 0, 1, &A, &P);
35  printf("%d %.8f %.3f\n", n, P, A);
36  return 0;
37 }
static const double lat
int n
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
void geod_polygon_addpoint(const struct geod_geodesic *g, struct geod_polygon *p, double lat, double lon)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
void geod_polygon_init(struct geod_polygon *p, int polylinep)
unsigned geod_polygon_compute(const struct geod_geodesic *g, const struct geod_polygon *p, int reverse, int sign, double *pA, double *pP)
static const double lon
void geod_init(struct geod_geodesic *g, double a, double f)
int main()
Definition: planimeter.c:23
API for the geodesic routines in C.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:14