Variables

Creating a Variable

A variable is created as a result of a measurement or a calculation. A newly created variable has a name and a definition. For instance, the variable myDistance in the example below is defined as the distance between points P and W in figure MyCube:

myDistance = |PW| : MyCube

In another example, variable myArea is a result of a calculation upon previously defined variables myVolume and myDistance:

myArea = 2 * myVolume / myDistance

Newly created variables are automatically recorded, along with their definitions, on the notepad.

Variable names can contain alphanumeric characters alone. Special and accented characters are not allowed. A variable name cannot contain spaces.

Variable names are case sensitive. Thus, myArea and MyArea will reference two distinct variables.

PI is reserved for the corresponding constant and cannot be used for newly created variables. However, it can be used in calculations.

Value of a Variable

Each variable has a numeric value. However, in most cases, this value remains transparent to the user. The user can create and solve Geometria problems without ever knowing the underlying values of the variables he or she has defined. To see the numerical value of a variable, type the variable in the calculator and click the Evaluate button. Due to roundup errors, the numeric values may slightly vary over the process of creating or solving the problem.

The value of a variable may change as a result of certain actions upon figures. If, in the example above, MyCube is scaled by the factor of 3, the value of myDistance will be implicitly multiplied by 3. The values of any variables that depend on myDistance, such as myArea, will be automatically updated as well.

However, the numerical value of the answer will be unaffected by actions upon figures. If, in the example above, the problem creator enters myDistance as the problem answer before scaling the figure, the value of the answer will not change, even though myDistance will carry a new value in all subsequent calculations. This note applies to all types of answer.

Therefore, the problem creator should consider (re)entering the answer before making the problem available to solvers.

Pinned Variable

After certain actions, the definition of a variable may become obsolete. For example, if point P or point W is erased, the definition of the variable myDistance above will become obsolete. Same if figure MyCube is removed. Such a variable is called pinned.

A pinned variable is no longer dependent upon its original definition and its value will no longer be updated. For example, erasing point P in figure MyCube will pin variable myDistance. If MyCube is subsequently scaled as described above, the value of myDistance will nevertheless stay the same.

If the action that pinned a variable is undone, the definition of the variable is restored and the variable becomes again targeted for updates.

Lifetime of a Variable

Once a variable is defined, it can be used in calculations and referenced in actions, such as measuring, drawing and transforming figures. A variable can also be used to answer a problem. A pinned variable can still be used in calculations and references.

A variable exists as long as it is recorded on the notepad. Clearing the notepad is the only way to remove a variable. Use caution since this action cannot be undone.

When the document, such as a problem or a solution, is saved, all the variables recorded on the notepad are saved, too.

See also:

Rename Variable

To rename a variable, select Rename Variable from the Edit menu. Alternatively, select the notepad record that defines the variable, right click and select Rename Variable from the popup menu.

A dialog will pop up. Select the variable you wish to rename from the drop-down list, enter the new name for the variable and click OK. The new name must be a valid variable name.

Click on the record that defines the variable on the notepad ahead of time, to have it automatically selected in the input box.

Renaming a variable will result in some of the notepad records being updated accordingly.

This action can be undone.

See also: