# [AR] Location-Based Problem

I am making an AR app that obtains the user’s GPS position (latitude/longitude) and the GPS position of some points of interest (yes, I am using the GeoLocation plugin).
Then actors or static meshes are instantiated in those positions of interest.

I can calculate and display on the screen the distance that separates the user from these points of interest.

The problem is that the actors created at these points are at a distance that does not correspond to reality.

By transforming its gps position to Cartesian coordinates, in UE4 the separation distance is very short, so much so that it seems that these points of interest are overlapping, when in reality they are separated by more than 50 meters.

This is the function that is used to convert gps coordinates to cartesian.

``````
# Converting lat/long to cartesian
import numpy as np

def get_cartesian(lat=None,lon=None):
R = 6371 # radius of the earth
x = R * np.cos(lat) * np.cos(lon)
y = R * np.cos(lat) * np.sin(lon)
z = R *np.sin(lat)
return x,y,z

``````

The distance between gps points is obtained using the Harvesine formula.

``````
static double CalculateDistanceBetween(const Coord& c1, const Coord& c2)
{