Titchener Illusion

Manipulate[With[{ram=Min[{(1-rl*Sin[Pi/k]),(1-rr*Sin[Pi/k])}],cp=Table[{Cos[a],Sin[a]},{a,0,2Pi-2Pi/k,2Pi/k}]},Graphics[Flatten[{Thickness[.003],RGBColor[.83,0,.24],
Circle[# (ram+rr*Sin[Pi/k])+{2,0},rr*Sin[Pi/k]]&/@cp,
Circle[#(ram+rl*Sin[Pi/k])+{-2,0},rl*Sin[Pi/k]]&/@cp,RGBColor[.95,.56,.1],Circle[{-2,0},ram rm],Circle[{2,0},ram rm],
If[sr,{RGBColor[.83,0,.24],Circle[# (ram+rr*Sin[Pi/k])+{-2,0},rr*Sin[Pi/k]]&/@cp,
Circle[#(ram+rl*Sin[Pi/k])+{2,0},rl*Sin[Pi/k]]&/@cp,RGBColor[.6,.74,.36],{Line[{{-5,#},{5,#}}],Line[{{-5,-#},{5,-#}}]}&[ram rm]},{}]}],PlotRange->{{-4,4},{-2,2}},ImageSize->520]],{{k,6,"number of circles"},2,24,1},
{{rl,.33,"radii of left red circles"},0,1},{{rr,.9,"radii of right red circles"},0,1},{{rm,.66,"radii of orange circles"},0,1},
{{sr,False,"reference objects"},{False,True}}]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Titchener Illusion" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/TitchenerIllusion/

Contributed by: Michael Schreiber

A full-function Wolfram Mathematica 6 system is required to edit this notebook.
GET WOLFRAM MATHEMATICA 6 »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »