orbits-lib/resources/orbits/circular_range.rb
# Returns an array containing all min..max ranges crossing
# the range from lower_bound to upper_bound.  For instance,
# >> range = Spatial::CircularRange.new(0, 45)
# >> range.denormalize(-180, 540)
# => [0..45, 360..405]
Returns an array containing all min..max ranges crossing
the range from lower_bound to upper_bound.
Returns an array containing all min .. max ranges crossing the range from lower_bound to upper_bound .
def denormalize(lower_bound, upper_bound)
      start = 360 * ((lower_bound - @max).to_i / 360 + 1)
      stop  = 360 * ((upper_bound - @min).to_i / 360 + 1)
      (start...stop).step(360).map { |s| (@min + s)..(@max + s) }
    end
def denormalize ( lower_bound , upper_bound ) start = 360 * ( ( lower_bound - @max ) . to_i / 360 + 1 ) stop = 360 * ( ( upper_bound - @min ) . to_i / 360 + 1 ) ( start ... stop ) . step ( 360 ) . map { | s | ( @min + s ) .. ( @max + s ) } end
Returns an array containing all min..max ranges crossing
the range from lower_bound to upper_bound.
Returns an array containing all min .. max ranges crossing the range from lower_bound to upper_bound .
# The first and last multiple of 360 we need to shift our range by
lower_bound
<not_specific>
upper_bound
<not_specific>