Class: Geospatial::RadialHistogram
- Defined in:
- lib/geospatial/histogram.rb
Instance Attribute Summary
Attributes inherited from Histogram
#bins, #count, #offset, #scale
Instance Method Summary collapse
- #add(point, value = 1) ⇒ Object
-
#initialize(center, min: -180,, max: 180, scale: 1) ⇒ RadialHistogram
constructor
A new instance of RadialHistogram.
Methods inherited from Histogram
#[], #each, #inspect, #map, #peaks, #size, #unmap
Constructor Details
#initialize(center, min: -180,, max: 180, scale: 1) ⇒ RadialHistogram
Returns a new instance of RadialHistogram.
81 82 83 84 85 |
# File 'lib/geospatial/histogram.rb', line 81 def initialize(center, min: -180, max: 180, scale: 1) super(min: min, max: max, scale: scale) @center = center end |
Instance Method Details
#add(point, value = 1) ⇒ Object
87 88 89 |
# File 'lib/geospatial/histogram.rb', line 87 def add(point, value = 1) super(point.bearing_from(@center), value) end |