Definitions of variables and functions play the same role in a figure that macro definitions do in a LATEX document: gathering and organizing information on which the figure depends. A variable is defined by supplying its type, name, and initial value. By far the most common data types in ePiX are double, P, and int. The name of a variable may consist (only) of letters (including the underscore character) and digits, and must begin with a letter:
my_var, my_var2, _MY_var, __, aLongVariableName; // valid my-var, 2var, v@riable, $x, ${MY_VARIABLE}; // not validVariable names are case-sensitive. There are numerous conventions regarding the significance of capitalization. Generally, make names descriptive but not unwieldy, and avoid names that begin with an underscore (unless you know what you're doing).
A function accepts ``arguments'' and ``returns a value''. To define a function in C++, you must specify the return type, the name of the function, the types of the arguments, and the algorithm by which the value is computed from the inputs. The code block
double f(double x) { return sqrt(1-x*x); }specifies the double-valued function