mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Simplify distance calculations
This simplifies the distance calculations and removes a dependency. This version uses propper math instead of my to simple previous version. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9ec155fad0
commit
7a594e3ec5
4 changed files with 26 additions and 14 deletions
|
@ -1,5 +1,4 @@
|
|||
#include "globe.h"
|
||||
#include <QGeoCoordinate>
|
||||
#ifndef NO_MARBLE
|
||||
#include "mainwindow.h"
|
||||
#include "helpers.h"
|
||||
|
@ -393,10 +392,3 @@ void GlobeGPS::reload()
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" double getDistance(int lat1, int lon1, int lat2, int lon2)
|
||||
{
|
||||
QGeoCoordinate c1(lat1 / 1000000.0, lon1 / 1000000.0);
|
||||
QGeoCoordinate c2(lat2 / 1000000.0, lon2 / 1000000.0);
|
||||
return c1.distanceTo(c2);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue