Step 2: Define a new function
Previous Topic  Next Topic 

A New Function f(x) dialog box will open.

You may recall that in Chapter 3, Part C we mentioned that “x” and “y” are reserved names.  If you have defined variables with these names, you are very likely to have major problems with graphs.  So we recommend that you do not use these names in your definitions.

You may recall seeing the Information button in the Edit Algorithm Definitions box.  It has the same function here.  It is useful for recalling (and inserting) our algorithm names, particularly as our algorithms list is getting longer and more complex.

By default, the cursor is placed in the function definition field.  So we can start typing our definition directly.  Recall that the equation of the line passing through two given points is:

      .  With our variables this is: .

Question: Why do we use ans1 instead of

Answer: ans1 is a string variable and y=f(x) is a real function not a display function!

You will probably notice that sometimes the function is not displayed properly. This is because by default the graph is set over the interval (-5,5) and our points are defined to range over the interval (-10,10).

The interval in which the graph is set depends on three main settings.

    1. The physical size of the graph in inches, which can be change in the View tab.
    2. The scale between ticks and the number of ticks per inch, both of which can be change in the Axes tab. 

The default number of ticks per inch is 5. For a normal Cartesian graph, this is usually a good number a larger number tends to make the graph look crowded.  (On the other hand, if we were to draw a number line, changing the number of ticks per inch would make perfect sense.)