Hello, I am trying to calculate the distance between two locations. The code I use is found below.
// Variables loc1 and loc2 are initialized previously
int distance = (int) loc1.getPosition().distance(loc2.getPosition())
However, the distance returned is far from what it should be.
loc1: Located at X:-170 Y:67 Z:371
loc2: Located at X:-173 Y:67 Z:371
The variable distance should be 3, but when running the code, it is 21. Does anyone know what I am doing wrong?