cacheable_kdtree 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/cacheable_kdtree/util.rb +4 -4
- data/lib/cacheable_kdtree/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDYxZjg3YzE2MmMwMzQ1ZWY3YzFmNGRiYmY4ODczNmM5OGRmNTk1MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzIxYWM3ZmVmODM1ZThjNGNjZTNhMzFlMGFhODgyZWM5NTVmZjVlNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWU3NDdjZGY1NDFlNTM4OGFjM2JkODFkZmFhODZjNTVkODY5ZWFlNzIxNjVh
|
10
|
+
Nzg4ZTYxMjUwMjBmZDJhYTYwNDgwNzU0ZDk3MDI3YThkOTdmYzFjYmYyMWUz
|
11
|
+
NzkxYTRhMzY2MTFlZTBiNTYzNzQwY2NkN2E0YjllNzJiZjZlODI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzUzNDJjZjQxOTEyOTJlNmVkOTg0NmM0ZjEwOGEzNmM2M2IwOTY3MWIzMTFk
|
14
|
+
YThiODJiNjg0MzU4NDJmNDQzOWMxMTZiMzlmNGQzNWMyZjAyNTdmMzAwY2Ri
|
15
|
+
M2NhZDg3ODVjYTcyM2MwNTdkNTIwNGZjMTBiZDEyODJhYTJjMDY=
|
@@ -33,10 +33,10 @@ class CacheableKdtree::Util
|
|
33
33
|
|
34
34
|
# I am using the law of cosines because it is faster than Haversine...
|
35
35
|
def self.distance_law_of_cosines(p1_lat, p1_long, p2_lat, p2_long, sphere_radius)
|
36
|
-
p1_lat = degrees_to_radians(p1_lat)
|
37
|
-
p1_long = degrees_to_radians(p1_long)
|
38
|
-
p2_lat = degrees_to_radians(p2_lat)
|
39
|
-
p2_long = degrees_to_radians(p2_long)
|
36
|
+
p1_lat = degrees_to_radians(p1_lat.to_f)
|
37
|
+
p1_long = degrees_to_radians(p1_long.to_f)
|
38
|
+
p2_lat = degrees_to_radians(p2_lat.to_f)
|
39
|
+
p2_long = degrees_to_radians(p2_long.to_f)
|
40
40
|
Math.acos(Math.sin(p1_lat) * Math.sin(p2_lat) +
|
41
41
|
Math.cos(p1_lat) * Math.cos(p2_lat) * Math.cos(p2_long - p1_long)) * sphere_radius
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cacheable_kdtree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Franssell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|