wrote, but not tested, rectangle functions
rectangles can now be defined with origin assumed as bottom left. doesnt quite answer partr 2though
changed to defined by diagonal.