Area and perimeter of squares and rectangles on the coordinate plane