def ellipse(im, foci, radius_inc)

      min_x = foci[0][0]
      max_x = foci[1][0]
      min_y = foci[0][1]
      max_y = foci[1][1]

      if foci[1][0] < min_x then
        min_x = foci[1][0]
        max_x = foci[0][0]
      end

      if foci[1][1] < min_y then
        min_y = foci[1][1]
        max_y = foci[0][1]
      end

      radius = radius_inc + Math.hypot(max_x-min_x, max_y-min_y)
      
      lower = ImageCoordinate[min_x-radius-1, min_y-radius-1, 0,0,0]
      upper = ImageCoordinate[max_x+radius+1, max_y+radius+1, 0,0,0]

      im.box_conservative(lower, upper, [:x, :y])
      
      draw(im) do |ic|
        
        xdiff0 = ic[:x] - foci[0][0]
        ydiff0 = ic[:y] - foci[0][1]
        xdiff1 = ic[:x] - foci[1][0]
        ydiff1 = ic[:y] - foci[1][1]

        if (Math.hypot(xdiff0, ydiff0) + Math.hypot(xdiff1, ydiff1) - radius).abs <= Math.sqrt(2) then
          true
        else
          false
        end

      end


    end
def ellipse(im, foci, radius_inc)

      min_x = foci[0][0]
      max_x = foci[1][0]
      min_y = foci[0][1]
      max_y = foci[1][1]

      if foci[1][0] < min_x then
        min_x = foci[1][0]
        max_x = foci[0][0]
      end

      if foci[1][1] < min_y then
        min_y = foci[1][1]
        max_y = foci[0][1]
      end

      radius = radius_inc + Math.hypot(max_x-min_x, max_y-min_y)
      
      lower = ImageCoordinate[min_x-radius-1, min_y-radius-1, 0,0,0]
      upper = ImageCoordinate[max_x+radius+1, max_y+radius+1, 0,0,0]

      im.box_conservative(lower, upper, [:x, :y])
      
      draw(im) do |ic|
        
        xdiff0 = ic[:x] - foci[0][0]
        ydiff0 = ic[:y] - foci[0][1]
        xdiff1 = ic[:x] - foci[1][0]
        ydiff1 = ic[:y] - foci[1][1]

        if (Math.hypot(xdiff0, ydiff0) + Math.hypot(xdiff1, ydiff1) - radius).abs <= Math.sqrt(2) then
          true
        else
          false
        end

      end


    end
Draws an ellipse into an image.

 @param [WritableImage] im the image into which to draw
 @param [Array] foci an array containing two arrays, each of which contains the x,y
  coordinates of one focus of the ellipse
 @param [Numeric] radius_inc the extra amount of distance (in pixels) beyond the
  distance between the foci that the ellipse should be drawn.  (2*radius_inc + dist
  between foci = major axis length)

 @return [void]