represents an axis-aligned filled rectangle from {xmin,ymin} to {xmax,ymax}.


corresponds to a unit square with its bottom-left corner at {xmin,ymin}.

Details and Options


open allclose all

Basic Examples  (5)

A unit square:

Two squares:

Various rectangles:

Differently styled rectangles:

Area and centroid:

Scope  (17)

Graphics  (7)

Specification  (3)

A unit square:

A rectangle parallel to each axis:

Short form for a unit cube with corner at the origin:

Styling  (1)

Color directives specify the face colors of rectangles:

FaceForm and EdgeForm can be used to specify the styles of the interior and boundary of a rectangle:

Coordinates  (3)

Use Scaled coordinates:

Use ImageScaled coordinates:

Use Offset coordinates:

Regions  (10)

Embedding dimension:

Geometric dimension:

Point membership test:

Get conditions for point membership:



Distance from a point:

Plot it:

Signed distance from a point:

Plot it:

Nearest point in the region:

Nearest points:

A rectangle is bounded:

Get its bounds:

Integrate over a rectangle:

Optimize over a rectangle:

Solve equations in a rectangle:

Options  (1)

RoundingRadius  (1)

Use rounded corners:

Applications  (6)

A simple bar chart:

Golden rectangle:

Square wheel:

The trajectory of the square wheel:

A Rectangle with equal side lengths is a square:

Visualize it:

Maximize the area of a rectangle with a fixed perimeter:

The resulting rectangle is a square:

Indeed, it will always be a square:

Properties & Relations  (9)

Use Rotate to get all possible rectangles:

Rectangle is a special case of Cuboid:

Rectangle is a special case of Parallelogram:

Rectangle is a special case of Polygon:

Rectangle is the union of two Triangle objects:

ImplicitRegion can represent any Rectangle region:

ParametricRegion can represent any Rectangle region:

MeshRegion can represent any Rectangle region:

BoundaryMeshRegion can represent any Rectangle region:

Possible Issues  (1)

RoundingRadius only affects Graphics:

Neat Examples  (3)

A collection of random squares:

A color wheel:

Digital petals:

Introduced in 1988
Updated in 1996