Chapter 2. Using KmPlot

KmPlot deals with named functions, which can be specified in terms of Cartesian coordinates (called “explicit functions”), polar coordinates or as parametric functions. To enter a function, choose Functions->Functions or click on the Functions button on the toolbar. You can enter new functions in the Function equation text box. Each function you enter must have a unique name (i.e., a name that is not taken by any of the existing functions displayed in the list box).

For more information on KmPlot functions, see Chapter 4.

Function Types

Explicit Functions

To enter an explicit function (i.e., a function in the form y=f(x)) into KmPlot, just enter it in the following form:

f(x)=expression
Where:
  • f is the name of the function, and can be any string of letters and numbers you like, provided it does not start with any of the letters x, y or r (since these are used for parametric and polar functions).

  • x is the x-coordinate, to be used in the expression following the equals sign. It is in fact a dummy variable, so you can use any variable name you like, but the effect will be the same.

  • expression is the expression to be plotted, given in appropriate syntax for KmPlot. See the section called “Mathematical Syntax”.

As an example, to draw the graph of y=x2+2x, enter the following into the functions dialog of KmPlot:

f(x)=x^2+2

Parametric Functions

Parametric functions are those in which the x and y coordinates are defined by separate functions of another variable, often called t. To enter a parametric function in KmPlot, follow the procedure as for an explicit function, but prefix the name of the function describing the x-coordinate with the letter x, and the function describing the y-coordinate with the letter y. As with explicit functions, you may use any variable name you wish for the parameter.

As an example, suppose you want to draw a circle, which has parametric equations x=sin(t), y=cos(t). In the KmPlot functions dialog, do the following:

  1. Enter the function for the x-coordinate, then press Enter:

    
    xcircle=sin(t)
    

  2. KmPlot automatically changes the function name for you to enter the y-coordinate function. Enter the function you want:

    
    ycircle=cos(t)
    

Entering Functions in Polar Coordinates

Polar coordinates represent a point by its distance from the origin (usually called r), and the angle a line from the origin to the point makes with the x-axis (usually represented by the Greek letter theta). To enter functions in polar coordinates, prefix the function name with the letter r. The dummy variable is now the angle, theta.

For example, to draw the Archimedes' spiral r=theta, enter:


rspiral(theta)=theta