Syntax

Nov 20th, 2007

You can define a graph by specifying the formulae for the coordinates x,y,z. For example, you can define a surface (two-variable function):

z = x^2 - y^2

You can draw a one-variable graph in the following way:

y = sin(x)
z = 0


Note: you should specify z = 0 because otherwise a two-variable graph will be drawn, where z changes according to the specified scale.

You can specify the center of the graph and its scale in the following way:

scale = 100
xcenter = 0
ycenter = 0
zcenter = 10

Note: by default, the center is in the point (0,0,0) and the scale is 10. In this case the variable x will take values from -5 to 5.

You can specify the number of steps for the variable on the entire segment using the commands xgrid, ygrid, zgrid:

xgrid = 100

You can use the parameters t,p,q to specify a function parametrically.

x = 2 * cos(t*3)
y = 2 * sin(t*5)
z = 0

The minimal and maximal values of the parameter and the number of calculated values on the given segment are specified in the following way:

tmin = 0
tmax = pi
tgrid = 100

It is specified for the parameters p,q in a similar way. Drawing a sample Torus:

pmin = 0; pmax = 2*pi
qmin = 0; qmax = 2*pi
pgrid = 20; qgrid = 25

r = 1.5 * cos(p) + 3

x = 1.5 * sin(p)
y = r * sin(q)
z = r * cos(q)

The list of standard functions and constants you can use while describing functions:

Sin, Cos, Tan, Arcos, Arcsin, Arctan, Exp, Abs, Ln, Sqrt, Round, Ceil, Floor, Min(a,b), Max(a,b)

Constants:

pi, e

Note the following:

- the syntax does not differentiate between commands written with lowercase and uppercase letters. That is, "r" and "R" will mean one and the same constant.

- you can type commands in one line using ";" as a delimiter.

- use the "#" character for comments, after this character you can enter any text and the program will skip it.

If you have any difficulties while using Archim or you have any suggestions concerning its improvement and development, contact us

Examples