Tent Problem

Author

Eric W. Weisstein
January 19, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/TentProblem.nb.

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

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

Code

TentProblem::usage="TentProblem[h,t,r] gives a graphic illustrating solution to the tent problem for horse at position h, tent at t, and river along the line r.  The field is assume to run from {0,0} to {1,0}."

TentProblem[h_List,t_List,r_List,opts___]:=Module[{f={{0,0},{1,0}},a1,a2,ha1,ha2,dr,w=.2},a1=2PerpendicularLine[t,r][[1]]-t;
a2=2PerpendicularLine[a1,f][[1]]-a1;
ha2=LineLineIntersection[f,{h,a2}];
ha1=LineLineIntersection[r,{ha2,a1}];
dr=r[[2]]-r[[1]];
Show[Graphics[{{GrayLevel[.7],Polygon[{r[[1]],r[[2]],r[[2]]+w{dr[[2]],-dr[[1]]},r[[1]]+w{dr[[2]],-dr[[1]]}}]},{GrayLevel[.85],Polygon[{{0,0},{1,0},{1,2},{0,2}}]},Line[f],Line[r],Line[{r[[2]]+w{dr[[2]],-dr[[1]]},r[[1]]+w{dr[[2]],-dr[[1]]}}],{Dashing[{.02,.02}],Line[{t,a1}],Line[{a1,a2}],Line[{h,a2}]},{Thickness[.015],Line[{h,ha2,ha1,t}]},{PointSize[.04],Point[t],Point[a1],Point[a2],Point[h],Point[ha1],Point[ha2]}}],opts,AspectRatio->Automatic]]

Graphic

TentProblem[{0,-.2},{.6,-.1},{{0,-1},{1,0}},
PlotRange->{{-.1,1},{-.7,.5}}]