C-PLOT

Scientific Graphics and Data Analysis

11.1.1. - How user functions work



User functions run as separate processes under the control of C-PLOT and exchange data and other information with the plot program. (See Appendix C for a list of standard user functions.)

You needn't know very much about programming to create your own functions. Prototype C-language files are included with the C-PLOT package, along with the required overhead modules. C-PLOT creates the files, invokes your favorite editor and runs the compiler for you. For ordinary functions you need only type in the lines of C code that describe your calculation. Appendix E contains additional information on writing user functions.


There are five types of user functions. The type number becomes part of the function name. The types are:

 Type   Arithmetic   Description 
 1   y = f(x)   Simple -- You give the range for x

    x = f(t)    
 2   y = g(t)   Parametric -- You give the range for t
    r = u(t)   (In 3D mode, change r to z.) 
    s = v(t)    

    x = f(x, y, r, s)    
 3   y = g(x, y, r, s)   Operation -- Transforms current data. 
    r = u(x, y, r, s)   (In 3D mode, change r to z.) 
    s = v(x, y, r, s)    

 4      Other -- You supply data (current 
       data is available). 

 5      Non-linear fitting -- See Chapter 12.