def geo_to_h3(coords, resolution)
      raise ArgumentError unless coords.is_a?(Array) && coords.count == 2

      lat, lon = coords

      if lat > 90 || lat < -90 || lon > 180 || lon < -180
        raise(ArgumentError, "Invalid coordinates")
      end

      coords = GeoCoord.new
      coords[:lat] = degs_to_rads(lat)
      coords[:lon] = degs_to_rads(lon)
      Bindings::Private.geo_to_h3(coords, resolution)
    end
def geo_to_h3(coords, resolution)
      raise ArgumentError unless coords.is_a?(Array) && coords.count == 2

      lat, lon = coords

      if lat > 90 || lat < -90 || lon > 180 || lon < -180
        raise(ArgumentError, "Invalid coordinates")
      end

      coords = GeoCoord.new
      coords[:lat] = degs_to_rads(lat)
      coords[:lon] = degs_to_rads(lon)
      Bindings::Private.geo_to_h3(coords, resolution)
    end
Derive H3 index for the given set of coordinates.

 @param [Array<Integer>] coords A coordinate pair.
 @param [Integer] resolution The desired resolution of the H3 index.

 @example Derive the H3 index for the given coordinates.
   H3.geo_to_h3([52.24630137198303, -1.7358398437499998], 9)
   617439284584775679

 @raise [ArgumentError] If coordinates are invalid.

 @return [Integer] H3 index.