Rectangle

Rectangle[{xmin,ymin},{xmax,ymax}]

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

Rectangle[{xmin,ymin}]

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

Details and Options

Examples

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:

Area:

Centroid:

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:

Wolfram Research (1988), Rectangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Rectangle.html (updated 2019).

Text

Wolfram Research (1988), Rectangle, Wolfram Language function, https://reference.wolfram.com/language/ref/Rectangle.html (updated 2019).

CMS

Wolfram Language. 1988. "Rectangle." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Rectangle.html.

APA

Wolfram Language. (1988). Rectangle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Rectangle.html

BibTeX

@misc{reference.wolfram_2024_rectangle, author="Wolfram Research", title="{Rectangle}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Rectangle.html}", note=[Accessed: 08-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_rectangle, organization={Wolfram Research}, title={Rectangle}, year={2019}, url={https://reference.wolfram.com/language/ref/Rectangle.html}, note=[Accessed: 08-December-2024 ]}