From 9a60f6c4e39c09187710608a9e225b6024b34364 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 27 Apr 2015 17:27:43 -0400 Subject: Add validation set ; fix lat/lon --- hdist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hdist.py') diff --git a/hdist.py b/hdist.py index 4944cb8..ca9dba6 100644 --- a/hdist.py +++ b/hdist.py @@ -6,10 +6,10 @@ def hdist(a, b): rearth = numpy.float32(6371) deg2rad = numpy.float32(3.14159265358979 / 180) - lat1 = a[:, 0] * deg2rad - lon1 = a[:, 1] * deg2rad - lat2 = b[:, 0] * deg2rad - lon2 = b[:, 1] * deg2rad + lat1 = a[:, 1] * deg2rad + lon1 = a[:, 0] * deg2rad + lat2 = b[:, 1] * deg2rad + lon2 = b[:, 0] * deg2rad dlat = abs(lat1-lat2) dlon = abs(lon1-lon2) -- cgit v1.2.3