Skip to content

Instantly share code, notes, and snippets.

View kucheruk's full-sized avatar
😁
Hello!

Evgeniy Kucheruk kucheruk

😁
Hello!
  • ATI.su
  • Saint-Petersburg, Russia
View GitHub Profile
@kucheruk
kucheruk / gist:2407778
Created April 17, 2012 17:50
haversine formula (miles/meters)
double miles = 3956d*2d*Math.Asin
(Math.Sqrt
(Math.Pow(Math.Sin
((orig_lat - dest_lat)*Math.PI/180d/2d),
2
)
+ Math.Cos(orig_lat*Math.PI/180d)
*Math.Cos(dest_lat*Math.PI/180d)
*Math.Pow(Math.Sin((orig_lon - dest_lon)*Math.PI/180d/2d), 2
)