Maximizing the Viewing Angle of a Painting

Manipulate[
painting=Graphics[{Thickness[0.03],Blue,Line[{{0,b},{0,b+t}}],Blue,PointSize[.05],Point[{0,b}],Blue,Point[{0,b+t}]}];
head=Graphics[Circle[{a+0.75,4.75},0.75]];
eye=Graphics[{PointSize[Large],Red,Point[{a,5}]}];
body=Graphics[Line[{{a+0.75,2.25},{a+0.75,4}}]];
leg1=Graphics[Line[{{a+0.25,0},{a+0.75,2.25}}]];
leg2=Graphics[Line[{{a+1.25,0},{a+0.75,2.25}}]];
arm1=Graphics[Line[{{a-1,4.5},{a+0.75,3}}]];
angleMarker=Graphics[{Circle[{a,5},5,{π-ArcTan[(t+b-5)/a],π-ArcTan[(b-5)/a]}],Text["θ",{a-4Cos[ArcTan[(t/2+b-5)/a]],5+4Sin[ArcTan[(t/2+b-5)/a]]}]}];
f[x_]:=-(t+b-5)/a x+b+t;
g[x_]:=-(b-5)/a x+b;
viewingAngle[x_]:=180/π(ArcTan[(t+b-5)/x]-ArcTan[(b-5)/x]);
point2=Graphics[{PointSize[Large],Red,Point[{a,viewingAngle[a]}]}];
viewPlot=Plot[viewingAngle[x],{x,0,20},AxesOrigin->{0,0},AxesLabel->{"x","θ"},PlotLabel->Style["viewing angle θ°",18]];
museumPlot=Plot[{f[x],g[x]},{x,0,a},AxesLabel->{"x",None},PlotRange->{{-.5,20.2},{0,20.2}},AspectRatio->1];
Text@Pane[Row[{Show[museumPlot,painting,head,eye,body,leg1,leg2,arm1,angleMarker,ImageSize->300],Column[{Show[viewPlot,point2,ImageSize->240],"",Style[Row[{Style["x",Italic]," = ",a,"'"}],18],Style[Row[{"viewing angle θ = ",N[viewingAngle[a]],"°"}],18]}]


}],ImageSize->{560,300}],
{{t,4,"size of painting"},2,8},
{{b,8,"placement of painting"},6,10},
{{a,10,"distance from wall to eye, x"},0.01,18},TrackedSymbols->True]

This Demonstration provides a visualization of this oft-asked optimization problem: How far from a painting hung high on a museum wall should a one-armed stick figure with a red eye stand, in order to maximize the viewing angle? The figure's eye is exactly five feet above the ground.

Contributed by: Marc Brodie (Wheeling Jesuit University)