Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingbychanche/39717b989229ec199beadee19f551b5c to your computer and use it in GitHub Desktop.
Save codingbychanche/39717b989229ec199beadee19f551b5c to your computer and use it in GitHub Desktop.
Calculates the distance between two given coordinates.....
10 REM CALCULATES THE DISTANCE
11 REM BETWEEN TWO GIVEN
12 REM COORDINATES.
13 REM
14 REM LAT- // LONGTITUTE
20 M=53.48:K=2.24
30 N=35.65:L=-139.83
40 R=6372.8:P=3.1452:D=P/180
50 A=SIN((L-K)*D/2):A=A*A
60 B=COS(M*D)*COS(N*D):C=SIN((N-M)*D/2)
70 C=C*C:D=SQR(C+B*A):E=D/SQR(1-D*D):F=ATN(E)
80 ? 2*R*F;" KM"
90 ? (2*R*F)*0.621;" MILES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment