Deluge script lacks advanced trigonometric functions like acos/atan. If you want to implement the great circle distance method, you'll need them. Here is some code I ported to deluge to fix this problem.
Nuanced IT - Zoho CRM/Creator developer based in Sydney, Australia.