The element command is most useful in a two-dimensional geometry screen; it creates objects that are restricted to a geometric figure.
element takes different types of arguments:
This creates a parameter restricted to the interval, with the given initial value and whose value can be changed in the given step sizes.
For example, the command t := element(0..pi) creates a parameter t which can take on values between 0 and π and has initial value π/2. It also creates a slider labeled t which can be used to change the values. The values of any later formulas involving t will change with t.
This creates a point which will be restricted to the curve, the initial position of the point is determined by setting the parameter (in the default parameterization of the object) to the initial value. If the point can be moved by the mouse (as it can when the geometry screen is in Pointer mode), then the motion will be restricted to the geometric object.
For example, the command A := element(circle(0,2)) creates a point labeled A whose position is restricted to the circle of radius 2 centered at the origin. Since the circle has default parameterization 2exp(i t), A starts out at 2exp(i/2).
This creates a point restricted to the polygonal line. With the sides numbered starting at 0, the value of floor(t) determines which side the point is on, and the value of frac(t) determines how far along the side the point is.
If a point A (corresponding to the complex number a) is defined as an element of a curve C and B is a point (corresponding to the complex number b), then A + B will be a point on C; it will be the projection onto C of the point corresponding to a + b.
Note that in this case, if B′ is another point, then A + (B − B′) isn’t the same as A + B − B′. The expression A + (B − B′) is interpreted as adding the point A, defined as a point on C, to the point B − B′, and so the sum will be on C. The expression A + B − B′ is interpreted as (A + B) − B′, and so the point B′ is not being added to a point defined as an element of the curve C, and so this sum may not be on C.