rgeo 1.1.1 → 1.1.2
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 +4 -4
- data/lib/rgeo/cartesian/analysis.rb +20 -17
- data/lib/rgeo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0760bb96d9e6654cf7cb09bd88b4a799f5ba249f573fd4c0484df2269ba50a0
|
4
|
+
data.tar.gz: 73928442258c96603367a340aac3cd1f93bed12471854e17cf14a712d58bb711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961f639e7a8985cbcdff0b166cdf2923a6a8a4c4143e55b66a2769d5897abdacb42a6abceaa2b92c870f648e867154df996e55d5ab9a50bbbe70a6c4eef5c7bd
|
7
|
+
data.tar.gz: ff8f393c6c5ef195c790836a4ba844867d54c7cf4e8a7266d86c4bd0f44025a58a90debad8a77521288ef1ffe8db0906575e52de9a5dc49d5507fb03aee43765
|
@@ -50,26 +50,29 @@ module RGeo
|
|
50
50
|
|
51
51
|
# Now add the angles and count revolutions.
|
52
52
|
# Again, our running sum is represented as a cos/sin pair.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
53
|
+
revolutions = 0
|
54
|
+
direction = nil
|
55
|
+
sin = 0.0
|
56
|
+
cos = 1.0
|
57
|
+
angs_.each_slice(2) do |(x, y)|
|
58
|
+
ready = y > 0.0 && (sin > 0.0 || sin == 0.0 && direction == -1) || y < 0.0 && (sin < 0.0 || sin == 0.0 && direction == 1)
|
59
|
+
if y != 0.0
|
60
|
+
s = sin * x + cos * y
|
61
|
+
c = cos * x - sin * y
|
62
|
+
r = ::Math.sqrt(s * s + c * c)
|
63
|
+
sin = s / r
|
64
|
+
cos = c / r
|
64
65
|
end
|
65
|
-
next unless
|
66
|
-
if
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
next unless ready
|
67
|
+
if y > 0.0 && sin <= 0.0
|
68
|
+
revolutions += 1
|
69
|
+
direction = 1
|
70
|
+
elsif y < 0.0 && sin >= 0.0
|
71
|
+
revolutions -= 1
|
72
|
+
direction = -1
|
70
73
|
end
|
71
74
|
end
|
72
|
-
|
75
|
+
revolutions
|
73
76
|
end
|
74
77
|
end
|
75
78
|
end
|
data/lib/rgeo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma, Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|