astromapper 1.0.49 → 1.0.50

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cef6ee3f34623291decb3188c009453944ad0b0
4
- data.tar.gz: af29463fc33648f38a2236a98b294cfd74aaa6e2
3
+ metadata.gz: abeb32d2e2754774de61ed116bce9c3d41640501
4
+ data.tar.gz: 36d328ec8b7388c9fa32b1f82a92b0c5e0970a36
5
5
  SHA512:
6
- metadata.gz: b02969a7b2a4745b1a06497a2c4268e8cf503f4e1b7a4a2431fa45f4841ea1772082c26f052685a1f23a1320e0347790531502b1118a6eb87b113b42c51c1e89
7
- data.tar.gz: 8c3231768d4ec568ff330f35cb532dfc53d4195aa9e504d6f12bd405db61118726369a727ff3d26e23e343018e3bad2e578744d9328aec1ece744ee79374ef3f
6
+ metadata.gz: 415cb5c301a296f7aceaca2eff3852a4059416849fb7cf89c79bd537a7bd409c8230fb16c2ac44a2b4a23984126c201c5ba92562076eb643640d004e6b35fe97
7
+ data.tar.gz: 50a19e2c7f59971a1d55948609857524db589631d43ef9db95c7b82a972cff156e42ceae33fc506ef0eebc0f342b4abcecf43f6b9a2c17d31a2ca3e06c41b9b9
@@ -34,18 +34,26 @@ module Astromapper
34
34
  keys = @volumes.map do |v|
35
35
  v[0..3]
36
36
  end
37
+ slopes = {}
37
38
  keys.each do |k|
38
39
  x = k[0..1].to_i
39
40
  y = k[2..3].to_i
40
41
  # @routes[k] = [] if @routes[k].nil?
42
+ slopes[k] = []
41
43
  (-4..4).to_a.each do |n|
42
44
  (-4..4).to_a.each do |m|
43
45
  x1 = (x + m)
44
46
  y1 = (y + n)
45
- d = Math.sqrt((x - x1)**2 + (y - y1)**2).floor
46
47
  next if y1 > 40
47
48
  next if x1 > 32
49
+ # Calcuate Route Distance
50
+ d = Math.sqrt((x - x1)**2 + (y - y1)**2).floor # Distance
48
51
  next if d == 0
52
+ # Calculate Route Slope to avoid slope collisions
53
+ s = (y1 - y) / (x1 - x)
54
+ next if slopes[k].include?(s)
55
+ slopes[k] << s
56
+
49
57
  c = "%02d%02d" % [x1, y1]
50
58
  # if (keys.include?(c) and !@routes[c].include?(k))
51
59
  if (keys.include?(c) and !@routes.include?("#{k}#{c}"))
@@ -1,3 +1,3 @@
1
1
  module Astromapper
2
- VERSION = "1.0.49"
2
+ VERSION = "1.0.50"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: astromapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.49
4
+ version: 1.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Merovex