Gaphs of Functions with Maple Mika Seppälä Plotting Graphs with Computers (1) Computers form plots of graphs or curves by computing a number of points on the graph or curve and then connecting these points to form an approximation of the graph. Here is a plot of the curve defined by the equation x 2 y 2 3x 2 y y 3 0. 2 The picture was generated by Maple 8 using its implicitplot command (in the plots library). To form the plot, Maple has substituted numeric values for x in the above equation and solved all these equations for y. To form the graph, Maple has then connected the computed points with straight lines. Mika Seppälä: Graphs of Functions Plotting Graphs with Computers (2) The plot generated by Maple looks suspicious at the origin. The problem is that several branches of the graph come to the origin. When Maple has computed points on the curve then it needs to figure out which points have to be connected with straight lines to form a correct plot. A better result can be obtained by using the polar coordinates. Substituting x r cos( ), y r sin( ) to the equation x2 y 2 2 3x 2 y y 3 0 and solving for r leads to the equation r sin3 3cos2 sin for the curve C. Mika Seppälä: Graphs of Functions Plotting Graphs with Computers (4) Polar coordinate representation gives immediately a parameterization of the graph. This is much better for plotting, since the parameterization also can be used to decide which points have to be connected to which points. Here are the two graphs. Implicit plot graph Mika Seppälä: Graphs of Functions Graph by a parameterization Scaling When plotting functions it is important to define the viewing rectangle correctly. Programs have built in methods to choose the viewing rectangle 1 but these methods do not always lead to desired results. The picture on the right was generated by Maple. It shows a portion of the graph of the function sin(50x). Maple has chosen, by default, to changes scales. In this picture, x-axis and yaxis use different scales. Hence the picture is not accurate even though it may be right for the purposes needed. 0.25 -0.25 -1 f x =sin 50x . Mika Seppälä: Graphs of Functions Viewing Rectangles – x Axis Consider again function sin(50x). Here are plots of the graph of this function for different x-intervals. Some of the plots are clearly incorrect. Sin(50x), -6x6 Sin(50x), -10x10 Mika Seppälä: Graphs of Functions Sin(50x), -0.1x0.1 Viewing Rectangles – y Axis Choosing the height of the viewing rectangle correctly is also important. If the y-axis range of the viewing rectangle is not specified, then Maple chooses it so that it can show all of the graph. This is not always a good choice. ex+sin(x), -10x10 ex+sin(x), -10x1 Mika Seppälä: Graphs of Functions