Distance between two locations


#1

Hello team,
I´m using nativescript with angular and typescript

How do I find the distance between two locations in meters?

My method:
public getDistance() {
let endLocation: Location = new Location();
endLocation.longitude = -75.7529147937894;
endLocation.latitude = 10.79036668315049;
this.distance = distance(this.location, endLocation);

    this.distanceResult = (this.distance *0.001).toFixed(3);

    console.log("distance -> " + this.distanceResult);
}

the result is : distance -> 8460.591

What does metric is this result?

thanks for yours contributions.


#2

If you find the difference in the longitudes and the difference in the latitudes, cant you convert the given values to meters?


#3

I don´t know.

only I need convert the result of distance method to meters or kilometers.

thanks!!!