Finding the perimeter or area of a rectangle in the coordinate plane