def hex_range(origin, k)
      max_hexagons = max_kring_size(k)
      out = H3Indexes.of_size(max_hexagons)
      pentagonal_distortion = Bindings::Private.hex_range(origin, k, out)
      raise(ArgumentError, "Specified hexagon range contains a pentagon") if pentagonal_distortion
      out.read
    end
def hex_range(origin, k)
      max_hexagons = max_kring_size(k)
      out = H3Indexes.of_size(max_hexagons)
      pentagonal_distortion = Bindings::Private.hex_range(origin, k, out)
      raise(ArgumentError, "Specified hexagon range contains a pentagon") if pentagonal_distortion
      out.read
    end
Derives H3 indexes within k distance of the origin H3 index.

 Similar to {k_ring}, except that an error is raised when one of the indexes
 returned is a pentagon or is in the pentagon distortion area.

 k-ring 0 is defined as the origin index, k-ring 1 is defined as k-ring 0
 and all neighboring indexes, and so on.

 Output is inserted into the array in order of increasing distance from the origin.

 @param [Integer] origin Origin H3 index
 @param [Integer] k K distance.

 @example Derive the hex range for a given H3 index with k of 0.
   H3.hex_range(617700169983721471, 0)
   [617700169983721471]

 @example Derive the hex range for a given H3 index with k of 1.
   H3.hex_range(617700169983721471, 1)
   [
     617700169983721471, 617700170047946751, 617700169984245759,
     617700169982672895, 617700169983983615, 617700170044276735,
     617700170044014591
   ]

 @raise [ArgumentError] Raised if the range contains a pentagon.

 @return [Array<Integer>] Array of H3 indexes within the k-range.