Graph

Presets Files

Graph

Graph is a tool to display functions in graphical form. The program itself is available as a standalone version and as a module in my Painter program.

Formules

You always start with entering a formule and its From, To and Step values. In a formule you can use the following functions and operators:

Predefined variables:

    PI

Accepted operators:

 + , - , * , / , ^ , MOD, DIV

[ MOD and DIV implicitly perform a trunc() on their operands ]

Functions:

The following functions are supported; it doesn't matter

if you use lower or upper case:

    COS, SIN, SINH, COSH, TAN, COTAN, ARCTAN, ARG,

    EXP, LN, LOG10, LOG2, LOGN,

    SQRT, SQR, POWER, INTPOWER,

    MIN, MAX, ABS, TRUNC, INT, CEIL, FLOOR,

    HEAV (heav(x) is =1 for x>0 and =0 for x<=0),

    SIGN (sign(x) is 1 for x>1, 0 for x=0, -1 for x<0),

    ZERO (zero(x) is 0 for x=0, 1 for x<>0),

    PH (ph(x) = x - 2*pi*round(x/2/pi))

    RND (rnd(x) = int(x) * Random)

    RANDOM (random(X) = Random; the argument X is not used)

  IMPORTANT:

     DO NOT USE BLANKS IN THE EXPRESSION.

Examples

100*cos(t)

50*sin(3*t)

t^2

Parametric Functions

Graph has two comboboxes where you can enter/select a formule. The parameter is always t. This means that if you want to graph the sin function you will enter in the y=f(t) box: sin(t)

If you would graph a function like this you would not see very much because everything is cramped together. That is where the x=f(t) box comes in. Here you can compute the x value for a given t. With the function above from -3.14 to 3.14 you would enter as x=f(t) function somethig like 30*t.

Graph Types

There are two Graph types: Graph y and Graph x,y.

Graph y

This is to graph the y=f(x) type of functions. Where you enter e.g t^2 in the y=f(t) box, and e.g 10*t in the x=f(t) box.

Graph x,y

This is to graph the x=cos(t), y=sin(t) type of functions. Allowing you to visualize Lissaous figures.

Example:

100*sin(t) as the y=f(t) function and

50*cos(3*t) as the x=f(t) function.

Background and Line Color

In graph you can modify the Line color by left-clicking the color in the color grid. You modify the background color by right-clicking a color in the color grid.

Line width

Modify the line width by selecting the line width from the listbox.


Graph Presets

Graph Files

Graph Presets

Like many of my programs also Graph has a library where you can add/delete/select.

Select

Select a Graph Preset by clicking its name in the dropdown list. The Graph will be drawn and the edit fields will be preset with the correct values, To get you started Graph comes with some presets allready ready for you to use. It gives you an idea about the beauty of Graphing.

Add Preset

Add a preset with right-click Add over the presets box. Enter a descriptive name when prompted and click OK. All the edit field values will be saved under your choosen name.

Delete Preset

Select a preset first and then right-click Delete over the presets box.


Graph Files

Graph Presets

Graph Files

Save a graph to a file with File Save As...

You can save in bmp, gif or jpg format.

When prompted for a file name enter the name with the correct extension.

Example

To save a Lissajous graph as a gif file you could enter as filename:

Lissajous.gif

When you do not add an extension, the file is by default saved in gif format.

About File formats

You will find that for saving Graphs the gif format is favourable because it saves your image in a very compact format. But you still have the choice of saving in a different format.

Copy to Clipboard

With copy you can copy the current graph to the clipboard for pasting in an other program.