diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-10-10 21:39:35 +0200 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-10-10 21:39:35 +0200 |
| commit | c245ad9089aeb8c7fc7683b6a8a20d04a74818f4 (patch) | |
| tree | 8602ce316a40dbf77d98fee78ea112cbc730c3d8 /math/gcDist.cpp | |
| parent | b208caff67c66cfa3e53da98c6d33c2c051c2b4e (diff) | |
Typesetting math section.
Diffstat (limited to 'math/gcDist.cpp')
| -rw-r--r-- | math/gcDist.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/math/gcDist.cpp b/math/gcDist.cpp deleted file mode 100644 index d661744..0000000 --- a/math/gcDist.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Great Cirlce Distance mit Längen- und Breitengrad. -double gcDist(double pLat, double pLon, double qLat, double qLon, double radius) { - pLat *= PI / 180; pLon *= PI / 180; qLat *= PI / 180; qLon *= PI / 180; - return radius * acos(cos(pLat) * cos(pLon) * cos(qLat) * cos(qLon) + - cos(pLat) * sin(pLon) * cos(qLat) * sin(qLon) + - sin(pLat) * sin(qLat)); -} - -// Great Cirlce Distance mit kartesischen Koordinaten. -double gcDist(point p, point q) { - return acos(p.x * q.x + p.y * q.y + p.z * q.z); -} - -// 3D Punkt in kartesischen Koordinaten. -struct point{ - double x, y, z; - point() {} - point(double x, double y, double z) : x(x), y(y), z(z) {} - point(double lat, double lon) { - lat *= PI / 180.0; lon *= PI / 180.0; - x = cos(lat) * sin(lon); y = cos(lat) * cos(lon); z = sin(lat); - } -}; |
