Illusory Contour Figure

Author

Eric W. Weisstein
June 6, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/RecreationalMath/IllusoryContourFigures.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/IllusoryContourFigures.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Graphics`Colors`;

Unit[v_]:=v/Sqrt[v.v]

RectangleLine[{x1_,x2_},a_]:=Module[{p={-#2,#1}&@@Unit[x2-x1]},
Polygon[{x1+p a,x1-p a,x2-p a,x2+p a}]
]

IllusoryContourFigure[n_,r_:.1,a_:.015]:=Module[{i},
Graphics[{
RectangleLine[#,a]&/@Table[{r#,#}&@{Cos[2 Pi i/n],Sin[2Pi i/n]},{i,n}]
}]
]

Figure

i=IllusoryContourFigure[8,.2,.03];
Show[GraphicsArray[{
Show[i,
AspectRatio->Automatic,
DisplayFunction->Identity,
PlotRange->All],
Show[i,
AspectRatio->Automatic,
DisplayFunction->Identity,
PlotRange->All,
Background->Black]}]
]