Z.u.L. > Documentation > Context Help

Syntax for Expressions

Name
Example
Description

+, -, *, /,^ or **
3.5*3+3/(4-5^2)
Elementary math.

Name of object
AB/CD
The name of a segment, circle, angle and other expression. The object must not depend on the current object. To refer to objects by name there is the syntax @name or @"name". This will not work in macros, however. If the object is not found, an error will occur.

Function
sin(a)
The functions abs, sign, sin, cos, tan, arcsin, arccos, arctan, sqrt, exp, log, round, ceil, floor, deg, rad, sinhyp, coshyp, angle180 and angle360. Note that the trigonometric functions work with degrees. To convert, use deg(x), or the functions rsin, rcos, rtan, rarcsin, rarccos, rarctan.

User Functions
f(a)
Evaluation of a user defined function object at a.

Pi
pi
The constant Pi.

x,y,z
x(P), y(P) , z(P)
x- and y-coordinates of a point, or the z-value of the point.

d
d(P,Q)
Distance of two points.

d
d(x)
Computes changes of the expression x. If x is a point, it computes movements.

sum
sum(x,f)
Sums up x. If f is negative or invalid, the sum is reset to 0.

a
a(P,Q,Z)
Size of angle PQZ.

scale
scale(x,a,b)
The relative position of x in [a,b), if x is in that interval. Else the expression becomes invalid.

if
if(e,e1,e2)
Returns e1, if e is valid, else e2.

invalid
invalid Returns an invalid expression.

&&,||,! !
(x<4 && y<4)
Logical expressions. 1 is true, 0 is false.

<, >, <=, >=, ==, ~=
x<y
Comparing numbers. ~= means "circa equal".

integrate
integrate(f,a,b)
integrate(f)
Integrates the function f from a to b using the Romberg method. f must be a function object (probably hidden). The y-part of f is used. If f shows points only, the Riemann sum is computed. If f is parametric, the area inside the curve is approximated or its length, if it is not filled.

zero
zero(f,a,b)
Find a zero of the function f in the interval a,b. The sign of f in a and b must be different. The procedure uses the secant method or interval bisection.

diff
diff(f,a)
Numerically differentiate f at a. This is the usual approximation (f(h)-f(-h))/(2h)

min,max
min(f,a,b)
Computes the point of the minimum (maximum) of f between a and b. min(a,b) and max(a,b) compute the minimum or maximum of a and b.

this
x(this)
Refers to the object containing the expression.

windoww,windowh,windowcx,windowcy
Returns the dimensions and center coordinates of the current screen.

pixel
Returns the pixel per coordinate unit. Not to be used in print.

simulate
simulate(e,x,f)
Sets the expression e to to the value x, recomputes the construction with this new value and returns the value of f. Only one simulation can be computed at any time, so simulations can not be nested. An expression, a fixed angle or a fixed circle can be used for e.

inside
inside(P,A)
Tests, if the point P is inside the object A. Returns 1/2, if it is on the boundary if A. A can be a polygon, a circle or an angle.

quad
quad(a)
Computes a*a. These are the quadrances in Rational Geometry.

spread
s(t)
Compute sin(t)^2. These are the spreads in
Rational Geometry.

Related topics: Fixed angles, Fixed Circles, Points, Object Properties, Reorder points, Functions and Curves

Next topic: Text