src/geoDogUtils.js
function(center, radius) {
  var latDegrees = radius/g_METERS_PER_DEGREE_LATITUDE;
  var latitudeNorth = Math.min(90, center[0] + latDegrees);
  var latitudeSouth = Math.max(-90, center[0] - latDegrees);
  var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth);
  var longDegsSouth = metersToLongitudeDegrees(radius, latitudeSouth);
  var longDegs = Math.max(longDegsNorth, longDegsSouth);
  return [
    [center[0], center[1]],
    [center[0], wrapLongitude(center[1] - longDegs)],
    [center[0], wrapLongitude(center[1] + longDegs)],
    [latitudeNorth, center[1]],
    [latitudeNorth, wrapLongitude(center[1] - longDegs)],
    [latitudeNorth, wrapLongitude(center[1] + longDegs)],
    [latitudeSouth, center[1]],
    [latitudeSouth, wrapLongitude(center[1] - longDegs)],
    [latitudeSouth, wrapLongitude(center[1] + longDegs)]
  ];
}
function(center, radius) {
  var latDegrees = radius/g_METERS_PER_DEGREE_LATITUDE;
  var latitudeNorth = Math.min(90, center[0] + latDegrees);
  var latitudeSouth = Math.max(-90, center[0] - latDegrees);
  var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth);
  var longDegsSouth = metersToLongitudeDegrees(radius, latitudeSouth);
  var longDegs = Math.max(longDegsNorth, longDegsSouth);
  return [
    [center[0], center[1]],
    [center[0], wrapLongitude(center[1] - longDegs)],
    [center[0], wrapLongitude(center[1] + longDegs)],
    [latitudeNorth, center[1]],
    [latitudeNorth, wrapLongitude(center[1] - longDegs)],
    [latitudeNorth, wrapLongitude(center[1] + longDegs)],
    [latitudeSouth, center[1]],
    [latitudeSouth, wrapLongitude(center[1] - longDegs)],
    [latitudeSouth, wrapLongitude(center[1] + longDegs)]
  ];
}
function ( center , radius ) { var latDegrees = radius / g_METERS_PER_DEGREE_LATITUDE ; var latitudeNorth = Math . min ( 90 , center [ 0 ] + latDegrees ) ; var latitudeSouth = Math . max ( - 90 , center [ 0 ] - latDegrees ) ; var longDegsNorth = metersToLongitudeDegrees ( radius , latitudeNorth ) ; var longDegsSouth = metersToLongitudeDegrees ( radius , latitudeSouth ) ; var longDegs = Math . max ( longDegsNorth , longDegsSouth ) ; return [ [ center [ 0 ] , center [ 1 ] ] , [ center [ 0 ] , wrapLongitude ( center [ 1 ] - longDegs ) ] , [ center [ 0 ] , wrapLongitude ( center [ 1 ] + longDegs ) ] , [ latitudeNorth , center [ 1 ] ] , [ latitudeNorth , wrapLongitude ( center [ 1 ] - longDegs ) ] , [ latitudeNorth , wrapLongitude ( center [ 1 ] + longDegs ) ] , [ latitudeSouth , center [ 1 ] ] , [ latitudeSouth , wrapLongitude ( center [ 1 ] - longDegs ) ] , [ latitudeSouth , wrapLongitude ( center [ 1 ] + longDegs ) ] ] ; }
Calculates eight points on the bounding box and the center of a given circle. At least one
geohash of these nine coordinates, truncated to a precision of at most radius, are guaranteed
to be prefixes of any geohash that lies within the circle.

@param {Array.<number>} center The center given as [latitude, longitude].
@param {number} radius The radius of the circle.
@return {Array.<Array.<number>>} The eight bounding box points.
Calculates eight points on the bounding box and the center of a given circle . At least one geohash of these nine coordinates truncated to a precision of at most radius are guaranteed to be prefixes of any geohash that lies within the circle .