Message Boards Message Boards

[GIF] Regiomontanus' angle maximization problem

Posted 9 years ago

Here is an animated GIF of a classical optimization problem: Regiomontanus' angle maximization problem. Below I give the Wolfram Language code that shows how to make it.

Angle maximization problem by Regiomontano

i = 0.80; a = 2.00; xini = 0.2; xmax = 5.0;
anima = Table[
   distance = (xmax + xini)/2 + (xmax - xini)/2 Cos[2*Pi*t];
   Column[{Column[{
       Style[
        "A painting hangs from a wall. Its height is 2.0 meters and", 
        FontFamily -> "Verdana"],
       Style[
        "and its bottom is 0.80 meters above the viewer's eye level.",
         FontFamily -> "Verdana"],
       Style[
        "How far from the wall should the viewer stand in order to", 
        FontFamily -> "Verdana"],
       Style["maximize the angle subtended by the painting?", 
        FontFamily -> "Verdana"]
       }],
     Graphics[{
       GraphicsComplex[
        {{distance, 0}, {0, 0}, {0, i}, {0, i + a},
         {0, i + a/2}, {0, i/2}, {distance/2, 
          0}, {distance - 5 xini*Cos[ArcTan[(i + a/2)/distance]], 
          5 xini*Sin[ArcTan[(i + a/2)/distance]]}
         },
        {Darker[Red], Thick,
         Circle[1, 
          4 xini, {\[Pi] - ArcTan[i/distance], \[Pi] - 
            ArcTan[(a + i)/distance]}],
         Black, Thickness[0.02],
         Line[{3, 4}],
         Thin, Dashed,
         Line[{1, 2, 3, 4, 1}],
         Line[{1, 3}],
         Text[
          Style[NumberForm[a, {5, 2}], FontFamily -> "Verdana", 
           Larger], 5, {1.5, 0}],
         Text[
          Style[NumberForm[i, {5, 2}], FontFamily -> "Verdana", 
           Larger], 6, {1.5, 0}],
         Text[Style[HoldForm[x], FontFamily -> "Verdana", Larger], 
          7, {0, 1}],
         Text[
          Style[HoldForm[\[Theta]], Darker[Red], 
           FontFamily -> "Verdana", FontSize -> 16], 8, {0, 0}]
         }],
       Inset["Insert image here", {distance, -1}, {0, -60}, 1],
       Inset[
        Plot[(ArcTan[(a + i)/x] - ArcTan[i/x])/Degree, {x, 0, 
          distance}, 
         PlotRange -> {{0, xmax}, {0, 
            Module[{x}, 
             NMaximize[{(ArcTan[(a + i)/x] - ArcTan[i/x])/Degree, 
                0 <= x <= xmax}, x][[1]]]}}, 
         PlotStyle -> Directive[Darker[Red], Thick], 
         AxesLabel -> {Style[HoldForm[x], FontFamily -> "Verdana", 
            Larger], 
           Style[HoldForm[\[Theta]], Darker[Red], 
            FontFamily -> "Verdana", FontSize -> 16]}],
        {-1 + xmax, i + a/3.5}, {0, 0}, 2.3]
       }, PlotRange -> {{-0.7, 1.3 + xmax}, {-1.3, i + a + 0.3}}, 
      ImageSize -> 400],
     Style["José Luis Gómez-Muñoz", FontFamily -> "Verdana"]
     }, Dividers -> All, Alignment -> {Center, Center}],
   {t, 0, 1, 0.01}
   ];
name = "regiomon.gif";
Export[name, anima]
POSTED BY: Jose Gomez
3 Replies
Posted 9 years ago

@Sam Carrettie thank you! There is a very similar Demonstration by another author in the Demonstrations site:

Maximizing the Viewing Angle of a Painting

enter image description here

POSTED BY: Jose Gomez

enter image description here - you earned "Featured Contributor" badge, congratulations !

Dear @Jose Gomez, this is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

POSTED BY: EDITORIAL BOARD

Jose, this is a nice model. By changing Table by Manipulate you can get the interactive interface, but then t does not represent x ;-)

enter image description here

POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract