Oberon Function Visualizer script

Note: a new much more advanced Oberon Function Visualizer is now available for CorelDRAW 10 and 11.

Use Oberon Function Visualizer script to create graphs of functions. You can enter a function in symbolic interpretation and the script will evaluate it and build a graph. You can use the following components to build the function body:

Numeric constants
Any number like 2, 6.9, -76.67. You can also use PI for 3.1415926... and E for 2.7182818...
One of the following operators:
+ (addition), - (subtraction), * (multiplication), / (division), ^ (power)
Parameter
Use T keyword to represent the parameter of the function. This parameter is then varied in the range specified in T Range control group in the dialog (see below)
Functions
One of the following functions:
SIN - Sine
COS - Cosine
TAN - Tangent
SQR - Square root
LOG - base-10 logarithm
LN - natural logarithm
EXP - exponent (e raised to the given power)
Parentheses
Use parentheses to control function evaluation order

When the graph is build a predefined variable T runs through values from From to To with the step of Step specified in T Range controls of the dialog.

Each current coordinate is calculated as follows:

y=f1(t)
x=f2(t)

Where f1 and f2 are defined by user. To draw a simple charts like y=sin(x) just define:

y=sin(t)
x=t

The script checks for correct syntax as you type the formulae and displays warnings in the status bar at the bottom of dialog.

You can use expressions in T Range controls either however all parameters here must be constants. When you type the range value, the status bar displays the current value entered. For example, entering "sin(pi/2)/2" in From field will result in value of 0.5 as displayed in the status bar immediately...

Screenshot of the Oberon Function Visualizer main dialog:

plotsh.gif (7624 bytes)

Live preview feature is based on my new User Interface Extension Run-Time Library for CorelSCRIPT which allows you paint in the dialog boxes. This new technology will be available to public as soon as I finish it.

Here are some examples of graphs built with this script:

Y=SIN(T)
X=T
T: From= -2*pi, To= 2*pi
Plot1.gif (352 bytes)
Y=(sin(t)^2)*sin(20*t)
X=T
T: From= -2*pi, To= 2*pi
Plot2.gif (1584 bytes)
Y=sin(t)
X=cos(t)
T: From= 0, To= 2*pi
Plot3.gif (313 bytes)
Y=sin(t)*t
X=cos(t)*t
T: From= 0, To= 2*pi
Plot4.gif (1200 bytes)
Y=sin(t)
X=cos(t)+t/pi
T: From= -4*pi, To= 4*pi
Plot5.gif (867 bytes)

Download Oberon Function Visualizer script for CorelDRAW 8:

CorelDRAW 9 script is available here.

CorelDRAW 10/11 macro is here.


[ CorelDRAW Scripts | CorelDRAW Users' Page | DTP & Graphics | Oberon Home Page ]
Copyright 2000 by Alex Vakulenko. All rights reserved.
This page was last revised on 11/25/02.