Haversine formula: Difference between revisions

Added Arturo implementation
m (→‎{{header|Phix}}: added syntax colouring the hard way)
(Added Arturo implementation)
Line 293:
{{Out}}
<pre>2887.26</pre>
 
=={{header|Arturo}}==
 
<lang rebol>radians: function [x]-> x * pi // 180
 
haversine: function [src,tgt][
dLat: radians tgt\0 - src\0
dLon: radians tgt\1 - src\1
lat1: radians src\0
lat2: radians tgt\0
 
a: add product @[cos lat1, cos lat2, sin dLon/2, sin dLon/2] (sin dLat/2) ^ 2
c: 2 * asin sqrt a
return 6372.8 * c
]
 
print haversine @[36.12 neg 86.67] @[33.94, neg 118.40]</lang>
 
{{out}}
 
<pre>2887.259950607111</pre>
 
=={{header|ATS}}==
1,532

edits