File: test_geo_utils.cpp

package info (click to toggle)
gdal 1.10.1%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (25 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include "ogr_xplane_geo_utils.h"

int main(int argc, char* argv[])
{
  double latA = 49, lonA = 2;
  double latB = 49.1, lonB = 2.1;
  double latC, lonC;
  double heading;
  double distance;
  
  heading = OGRXPlane_Track(latA, lonA, latB, lonB);
  distance = OGRXPlane_Distance(latA, lonA, latB, lonB);
  OGRXPlane_ExtendPosition(latA, lonA, distance, heading, &latC, &lonC);
  printf("heading=%f, distance=%f\n", heading, distance);
  printf("%.15f=%.15f, %.15f=%.15f\n", latB, latC, lonB, lonC);
  
  heading = OGRXPlane_Track(latB, lonB, latA, lonA);
  distance = OGRXPlane_Distance(latB, lonB, latA, lonA);
  OGRXPlane_ExtendPosition(latB, lonB, distance, heading, &latC, &lonC);
  printf("heading=%f, distance=%f\n", heading, distance);
  printf("%.15f=%.15f, %.15f=%.15f\n", latA, latC, lonA, lonC);

  return 0;
}