Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Haversine-formula/PicoLisp/haversine-formula-1.l
Normal file
17
Task/Haversine-formula/PicoLisp/haversine-formula-1.l
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(scl 12)
|
||||
(load "@lib/math.l")
|
||||
|
||||
(de haversine (Th1 Ph1 Th2 Ph2)
|
||||
(setq
|
||||
Ph1 (*/ (- Ph1 Ph2) pi 180.0)
|
||||
Th1 (*/ Th1 pi 180.0)
|
||||
Th2 (*/ Th2 pi 180.0) )
|
||||
(let
|
||||
(DX (- (*/ (cos Ph1) (cos Th1) 1.0) (cos Th2))
|
||||
DY (*/ (sin Ph1) (cos Th1) 1.0)
|
||||
DZ (- (sin Th1) (sin Th2)) )
|
||||
(* `(* 2 6371)
|
||||
(asin
|
||||
(/
|
||||
(sqrt (+ (* DX DX) (* DY DY) (* DZ DZ)))
|
||||
2 ) ) ) ) )
|
||||
4
Task/Haversine-formula/PicoLisp/haversine-formula-2.l
Normal file
4
Task/Haversine-formula/PicoLisp/haversine-formula-2.l
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(prinl
|
||||
"Haversine distance: "
|
||||
(round (haversine 36.12 -86.67 33.94 -118.4))
|
||||
" km" )
|
||||
Loading…
Add table
Add a link
Reference in a new issue