0

So for example, I have two pairs of coordinates: (103.82 W, 32.024 N) and (104.2 W, 32.587 N). I'm trying to figure out how to calculate the distance between these two points and then represent that distance in DMS form. When I use the distance formula, I obtain a decimal number that does not accurately represent my desired number when I convert it to DMS format. I'm supposed to use the distance formula, so I'm not sure what I'm missing here or what I could be doing wrong. I don't believe I need to use the haversine formula for this.

Any help would be greatly appreciated!

  • Is this a coding question? What language are you using? What have you tried, where is your code or pseudo code? – DCTID Feb 20 '19 at 04:19

1 Answers1

0

The Rosetta Code web site has working code examples in various computer languages (Java, JavaScript, Python, and many others) to compute the distance between two lat/lon coordinates using the Haversine formula.

You can verify your distance results using this online distance calculator for comparison.

Given a coordinate in decimal degrees you can convert that number into the DMS components or vice versa. The formula has been answered in a related answer and there are online converters to convert between DMS and decimal degrees.

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75