/ Published in: Java
Yes, I realize that this won't work with j2me, but RIM has implemented some good helper classes to make this calculation much easier.
This calculation uses the Haversine formula.
Expand |
Embed | Plain Text
public double calculateDistance(double lat1, double lon1, double lat2, double lon2) { try{ double R = 6371; // km double d = R * c; return d; e.printStackTrace(); } return 0; }
Comments
Subscribe to comments
You need to login to post a comment.

You can disregard lines 12 and 13. They were put there for debug purposes and I forgot to remove them :D