We will see a code for finding coordinatesof your current position and we will use haversine formula to find distance between two points in Earth.
W3schools example
Click the button to get your coordinates.
This calculator is used to set two locations and calculate the distance between those points.