File: PyGetIntersect.cpp

package info (click to toggle)
geographiclib 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,572 kB
  • sloc: cpp: 27,765; sh: 5,463; makefile: 695; python: 12; ansic: 10
file content (16 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <GeographicLib/Intersect.hpp>
#include <GeographicLib/Geodesic.hpp>

extern "C" void intersect(double lat1, double lon1, double az1,
                          double lat2, double lon2, double az2,
                          double *o_dX, double *o_dY) {
  const GeographicLib::Geodesic
  geod(GeographicLib::Constants::WGS84_a(),
       GeographicLib::Constants::WGS84_f());
  const GeographicLib::Intersect intersector(geod);

  GeographicLib::Intersect::Point p0;
  p0 = intersector.Closest(lat1, lon1, az1, lat2, lon2, az2);
  *o_dX = p0.first;
  *o_dY = p0.second;
}