If you dont know how to get the distance between coordinates then you are at the right place. Find the value of the latitude in radians. You are given two coordinates x1 y1.
The linear distance between the two points is the square root of the sum of the squared values of the x-axis distance and the y-axis distance.
Double b lng1-lng2FlatEarthDistdistPerLnglat1. Distance sqrty2 - y1 y2 - y1 x2 - x1 x2 - x1 Now lets move on to the implementation part. Here is a JAVA Program to find the distance between two GPS Coordinates. SystemoutprintlnDistance between them is Pointdistancep1 p2.