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)
34  n = geod_polygon_compute(&g, &p, 0, 1, &A, &P);
35  printf("%d %.8f %.3f\n", n, P, A);
36  return 0;
37 }
geod_polygon_compute
unsigned geod_polygon_compute(const struct geod_geodesic *g, const struct geod_polygon *p, int reverse, int sign, double *pA, double *pP)
geodesic.h
API for the geodesic routines in C.
A
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
geod_geodesic
Definition: geodesic.h:168
n
int n
Definition: BiCGSTAB_simple.cpp:1
geod_init
void geod_init(struct geod_geodesic *g, double a, double f)
A
Definition: test_numpy_dtypes.cpp:298
main
int main()
Definition: planimeter.c:23
geod_polygon_addpoint
void geod_polygon_addpoint(const struct geod_geodesic *g, struct geod_polygon *p, double lat, double lon)
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
geod_polygon_init
void geod_polygon_init(struct geod_polygon *p, int polylinep)
p
float * p
Definition: Tutorial_Map_using.cpp:9
P
static double P[]
Definition: ellpe.c:68
lon
static const double lon
Definition: testGeographicLib.cpp:34
geod_polygon
Definition: geodesic.h:206
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:35