A rectangle is a four-sided polygon with two sets of parallel sides. The term “rectangle” can refer to the geometric figure, the plane figure that contains it, or informally to the differentiator between it and other quadrilaterals. A rectangle with vertices at (0,0), (a,0), (a,b), and (0,b) is denoted as Rect(a,b).
The opposite sides of a rectangle are equal in length; thus, the rectangle is both a parallelogram and a rhombus. The diagonals of a rectangle intersect at right angles; therefore, the rectangle is also a square. All rectangles are convex polygons but not all convex polygons are rectangles. The area A of a rectangle with sides of length a and b is given by A = ab. The perimeter P of a rectangle is given by P = 2(a + b).