Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Double xDistance = deg2rad(x2 - x1);
- Double yDistance = deg2rad(y2 - y1);
- Double a = Math.sin(xDistance / 2) * Math.sin(xDistance / 2)
- + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))
- * Math.sin(yDistance / 2) * Math.sin(yDistance / 2);
- Double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
- double deg2rad(double deg) {
- return (deg * Math.PI / 180.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement