Duplicate:
- Working with latitude/longitude values in Java
- How do I calculate distance between two latitude longitude points?
I need to calculate the distance between two points given by two coordinates. The project I am working on is a Java-project, so Java-code will be great, but pseudo-code can also be given, then I can implement it myself :)
As you probably know, there are three ways to represent coordinates:
- Degrees:Minutes:Seconds (49°30'00"N, 123°30'00"W)
- Degrees:Decimal Minutes (49°30.0', -123°30.0'), (49d30.0m,-123d30.0')
- Decimal Degrees (49.5000°,-123.5000°), generally with 4-6 decimal numbers.
It's the third way my coordinates are given in, so the code for this values will be preferred :)