rectangle attractor

iterates to find the inscribed rectangle inside a convex quadrilateral, if it exists

You are now following this Submission

No input arguments. Starting at any point [circled in green] on the [black] quadrilateral,
we move in straight [blue] lines inside, horizontally and then vertically,
taking left or right 90-degree turns to reflect off of the convex 4-gon
whenever we impinge on its edge. (Of course, this is different from the
way a light ray reflects from a mirror physically, which is by the law of
equal angles of incidence and reflection.) As we continue this process,
a pattern emerges, either cyclic or chaotic. [Note that the final
nine iterations are highlighted in yellow, and the stopping point is
circled in red.]

Cite As

Lang Withers (2026). rectangle attractor (https://www.mathworks.com/matlabcentral/fileexchange/57964-rectangle-attractor), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
2.0.0.0

A better understanding of the conditions for the inscribed rectangle to exist, and other cases, has been included. This version excludes the degenerate case so that only the more interesting cases are run.

1.0.0.0

initial version v1.0