           minSqDistRight = sqDist
           closestPointRight = p
   return [closestPointLeft, closestPointRight]
-
-

simplify = require 'simplify-js'

d3plus.geom.largestRect = (poly, options) ->
  ## For visualization debugging purposes ##
  events = []



  ########################################
  area = Math.abs(d3.geom.polygon(poly).area()) # take absolute value of the signed area
  if area is 0
    d3plus.console.error 'polygon has 0 area'
    return null
  # get the width of the bounding box of the original polygon to determine tolerance
  [minx, maxx] = d3.extent poly, (d) -> d[0]
  [miny, maxy] = d3.extent poly, (d) -> d[1]
