Point of maximum viewing angle BRIEF ABSTRACT From a given point Q what point P on a nearby surface gives the greatest angle of inclination as we view P from Q? GENERAL INFORMATION FileName: VIEWUP Full title: Point of Maximum Viewing Angle Developer: Brian J. Winkel, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Contact: Brian J. Winkel, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Phone: 812-877-8412. Email: winkel@rose-hulman.edu. FAX: 812-877-3198. Support: The production of this material is supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849: Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering and the Arvin Foundation of Columbus IN. STATEMENT OF PROBLEM From the point P = (15, 15, -4) find the point(s) Q on the surface z = s(x,y) = 10 - .1 x^2 - .03y^2 such that we can see Q from P and the angle of inclination between the horizontal and the line from P to Q is greatest. KEYWORDS Visualization, optimization, vectors, three-dimensional figures, distance, angle, gradient. TEACHER NOTES ISSUES RELATED TO THE PROBLEM There are two components to this problem, both of which have significant visualization and geometry components. The first component is an optimization problem in which we try to maximize an angle, but the construction of this angle requires understanding and visualization in three dimensional space. The second component is one in which we attempt to describe a border region so that beyond this region we cannot see points on a surface from a given point. Prerequisites Optimization of a function of two variables, dot product, inverse trigonometric functions, implicit plotting. Time allotment - time management Expectations Future payoffs Extensions References and Sources POSSIBLE SOLUTION(S): We plot the surface z = s(x, y) and the point P s[x_,y_] = 10 - .1 x^2 - .03y^2; P = {15,15,-4}; p1 = Plot3D[s[x,y],{x,-10,10},{y,-10,10}, AxesLabel->{"x","y","z"}] p2 = Graphics3D[{PointSize[.03],Point[P]}] Show[p1,p2,PlotRange->{{-10,20},{-10,20},{-10,10}}] We compute the angle between the line of sight to the surface at point (x, y, s(x,y)) and the horizontal and determine the point Ps where this angle is maximum. t[x_,y_] = ArcTan[(s[x,y]-P[[3]])/ Sqrt[(y-P[[2]])^2 + (x-P[[1]])^2]]; We plot the function t(x,y) to examine roughly where the maximum might be. Plot3D[t[x,y],{x,-10,20},{y,-10,20}] ContourPlot[t[x,y],{x,-10,20},{y,-10,20}] We set the partial derivatives equal to 0 to determine the maximum value of t(x,y) near x = 2.5 and y = 5.0. tx[x_,y_] = D[t[x,y],x]; ty[x_,y_] = D[t[x,y],y]; sol = FindRoot[{tx[x,y]==0,ty[x,y]==0},{x,2.5},{y,5}]; We identify the point which maximizes t(x,y) as Ps and calculate the maximum angle as about 38.9 degrees or 0.679 radians. Ps = {x,y,s[x,y]}/.sol {3.37746, 7.38058, 7.22508} t[x,y]/.sol//N 0.679424 t[x,y]/Degree/.sol//N 38.9281 But can we see this point Ps from our given point P? We need to determine the points on the surface z = s(x, y) we can see from P. We compute the direction of the line of vision from our point P to a typical point on the surface z = s(x,y). l[x_,y_] = P - {x,y,s[x,y]}; We find the points on the surface s(x,y) = z which form the extreme boundary of all the points on the surface which can be seen from our point P, by determining where the line of vision to the surface is perpendicular to the gradient to the surface. grads[x_,y_] = {D[s[x,y],x],D[s[x,y],y],-1}; We form the dot product between the line of sight from our point P to the surface and the gradient to the surface. h[x_,y_] = l[x,y].grads[x,y]; We plot those points where h(x,y) = 0. hp = ImplicitPlot[h[x,y]==0,{x,-10,20},{y,-10,20}] We plot our point P from which we look - grey, and the point on the surface which we just calculated as offering the maximum angle between the line if sight from P to the surface and the horizontal. Ppt = Graphics[{PointSize[.02],Point[{P[[1]],P[[2]]}], Point[{Ps[[1]],Ps[[2]]}]}] -Graphics- We examine the points and the see that our point Ps is just on the edge of the set of points on the surface z = s(x,y) which can be seen from P. Show[hp,Ppt,AxesLabel->{"x","y"},AspectRatio->Automatic] cp = ContourPlot[s[x,y],{x,-10,20},{y,-10,20}] We now show our point P (upper right hand corner), our contour plot of the surface z= s(x,y), the line of points which are at the extreme of the region of visibility, and the point Ps which is on that line of visibility. Show[{cp,hp,Ppt},PlotRange->{{-10,20},{-10,20}}, Axes->True] Further we show several elements of the geometry including our vector from P to Ps, a horizontal vector "under" this vector, and we compute and offer a plot from a viewpoint perpendicular to the plane of these vectors to see if the maximum angle is about 38 degrees. The point Ps. ps = Show[Graphics3D[{PointSize[.03],Point[Ps], Line[{P,Ps}]}],Axes->True] Ls, the vector connecting P and Ps, and a plot of Ls. Ls = P - Ps {11.6225, 7.61942, -11.2251} ph = Show[Graphics3D[ Line[{P,{Ps[[1]],Ps[[2]],P[[3]]}}]], PlotRange->{{-10,20},{-10,20},{-10,10}},Axes->True] A horizontal vector "under" Ls. Hs = {Ls[[1]],Ls[[2]],0} {11.6225, 7.61942, 0} We compute the viewpoint to give us true angle vision. view = Cross[Ls,Hs] {85.5286, -130.464, 0.} Here we show the configuration in one viewpoint. Show[ps,p1,p2,ph,PlotRange->{{-10,20},{-10,20},{-10,10}}, AxesLabel->{"x","y","z"}] And here we show the configuration in a viewpoint which shows the true angle. Show[ps,p1,p2,ph,PlotRange->{{-10,20},{-10,20},{-10,10}}, AxesLabel->{"x","y","z"}, ViewPoint->view] ISSUES IN SOLUTION