Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
15
Task/Haversine-formula/Ring/haversine-formula.ring
Normal file
15
Task/Haversine-formula/Ring/haversine-formula.ring
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
decimals(8)
|
||||
see haversine(36.12, -86.67, 33.94, -118.4) + nl
|
||||
|
||||
func haversine x1, y1, x2, y2
|
||||
r=0.01745
|
||||
x1= x1*r
|
||||
x2= x2*r
|
||||
y1= y1*r
|
||||
y2= y2*r
|
||||
dy = y2-y1
|
||||
dx = x2-x1
|
||||
a = pow(sin(dx/2),2) + cos(x1) * cos(x2) * pow(sin(dy/2),2)
|
||||
c = 2 * asin(sqrt(a))
|
||||
d = 6372.8 * c
|
||||
return d
|
||||
Loading…
Add table
Add a link
Reference in a new issue