These computations don't make any sense.  I think it would be simpler if you added 1000 to each of left, top, right, bottom coordiantes so that they had a range of 0 to 2000 rather than -1000 to 1000