File: cgeoid.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 (14 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "cgeoid.h"
#include "GeographicLib/Geoid.hpp"

extern "C"
double HeightAboveEllipsoid(double lat, double lon, double h) {
  try {
    // Declare static so that g is only constructed once
    static const GeographicLib::Geoid g("egm2008-1");
    return h + GeographicLib::Geoid::GEOIDTOELLIPSOID * g(lat, lon);
  }
  catch (...) {
    return GeographicLib::Math::NaN();
  }
}