Expressions editing

Mathematical expressions are edited by ordinary keyboard typing using the "hot keys" combinations and (or) with the help of the mathematical toolbox. In addition, you can use the suggestion window, displaying all the available default and user expressions.

Here is a small editing tutorial.

Initially, the expression is represented by an empty line symbol:

This symbol means that you can replace it with necessary formula elements. The present symbol does not have any mathematical meaning. When trying to calculate an expression containing this symbol, an error message appears.

Cursor keys let you move inside formulas. [Left] or [Right] arrow keys move the cursor sequentially from one formula item to another one. Pressing the [Up] or [Down] arrow keys moves the cursor to the nearest upper or lower node. Key combination [Ctrl]-[Right arrow] moves the cursor, skipping enclosed elements. Key combination [Ctrl]-[Space bar] moves the cursor to the higher level node.

Example:

The following example introduces the expression editing from the very beginning, from the empty line symbol. We have the symbol shown in the above figure in the edit box. The cursor is in the "preceding the operation" position. Enter the number "1234.5678".

When you enter a number (string), the cursor comes to the position "inside the line," characterized by a lower solid line. The figure also demonstrates the number gaps simplifying the number reading process. The cursor can be moved to another position inside the line. Press [Left][Left][Left][Left][Left].

As the figure shows, the cursor has moved five symbols left. Now, the line editing occurs in another position. Enter "90".

To raise a number to a power, use the [Shift]"^" key.

In addition to the previously entered number, a new empty line symbol near the cursor appears. This means that you can enter a necessary number. Enter "2".

Now we need to add a new expression to the previous result. First, position the cursor behind the "power to" symbol. Press [Right][Right].

The cursor is now located behind the entered operation and denotes the space where a new operation or string is to be entered. We will do addition. Press "+".

The addition symbol appears. Now, enter the number "789".

The result number is to be divided by a new number. Initiate division by pressing "/".

The cursor moves to the denominator position. Now, we should define the denominator value. Let it be the cubic root of 27.89. Enter the root by pressing [Shift]"/".

Now, the cursor is in the radicand expression. Enter its value.

Now, pressing the [Left] key sequentially, move the cursor to the index of the radical.

And enter the index value.

Symbol and operation deletion

Symbol deletion is very simple. As with other editors, symbols can be deleted by moving the cursor to the necessary symbol and pressing the [Del] key (the symbol to be deleted is by the right side of the cursor) or the [Backspace] key (the symbol is on the left).

Example:

Let's continue the previously started example. We need to delete the last symbol of the radical expression. To achieve this effect, we move the cursor to the position displayed in the figure, either with the help of the cursor (arrow keys) or the mouse:

And press the [Del] key. Done:

A previously entered operation can also be deleted. The operation deletion means deleting the operation symbol but keeping its parameters. This procedure is carried out by pressing the [Del] key when the cursor is in the position "preceding the operation."

Example:

Put the cursor in the position preceding the root.

It is now located before the operation. Press the [Del] key.

As we can see, all the parameters - the radicand and the index of root - remain. We deleted just the root. The analogous method can be applied to division symbol deletion. Press [Up] in the last position to put the cursor before the division symbol:

,

and press [Del]:

Finally, let's delete the exponentiation. Put the cursor at its symbol (it does not have a graphical representation):

And press [Del].

The described method lets the user delete any symbols or operations in the program.

Operation input using selection

Some of the operation parameters can have expressions containing other operations. For convenience while entering such operations, selecting the formula parts is recommended.

Example:

Let's take the previous example expression and divide it by a certain number. First, we need to select it with the mouse or cursor keys. Selecting the procedure with the cursor keys is achieved by sequentially pressing [Shift][Up] or [Shift][Down] until you select your expression.

Now, press "/" to enter the division operation.

As we can see, the selected expression is now in the numerator position. The denominator (where the cursor is located) is empty. We should enter an expression here. Enter "sin(3)+cos(5)".

Strings "sin" and "cos" have another color. It is for ease of editing. Syntax highlight colors are adjusted in the options dialog . Now, let's extract the square root of the denominator expression. Here, selection is also useful. The cursor is now at the rightmost position. Therefore, selection is done by pressing [Shift][Left] until the whole expression is selected.

Enter the root elicitation operation by pressing "\".

The same selection process can be used for other operations.

Editing with clipboard

Natural Calculator supports clipboard operations. This allows the user to edit similar expressions, formulas, operations, and their parts much faster and easier.

Working with the clipboard is carried out with the help of the hot-keys or the toolbar buttons, described here.

Example:

Let's take the previous example and enter a new formula under the existing one. To do this, press [Enter] when the cursor is not in the initial position. Pressing [Enter] in the beginning cursor position creates a new formula above the existing one.

So, the cursor is in the new formula position, which is expressed by an empty line.

Move the cursor to the upper formula, and select the "raising to a power" operation. This can be achieved by putting the cursor before the operation (with the mouse or cursor keys) and pressing [Shift][Right].

Now, copy the selected expression to the clipboard by pressing [Ctrl][Ins]. Then, move the cursor to the lower empty symbol and insert the copied expression by pressing [Shift][Ins] or the insert button in the toolbar. Done:

Now, let's add the new expression to the radical expression from the previous formula.

Select it, and copy to the clipboard.

Then, insert it at the end of the second formula.

Finally, let's insert the addition operation. Put the cursor before "sin," and press "+". Result:

 

Thus, the clipboard can be useful in the process of expression editing. 

Undo and redo

The editor supports the undo and redo operations. These functions allow the user to cancel an operation if it is incorrect. You can also repeat the cancelled operations later, if necessary. The Undo function is selected by pressing the key combination "Ctrl+Z" or the button .  The Redo function is selected by pressing "Ctrl+Y" or the equivalent button .

Entering functions using the mathematical toolbar

The mathematical toolbar contains buttons responsible for the most widely used functions. They can also be used in editing. Put the cursor in the necessary position and, if needed, select the expression to be a function argument and press the relevant function button.

Example:

The process of function insertion is very simple. Before insertion, we have:

Select function "sin" from the panel:

After insertion:

Example:

The following expression is to be the arccos function argument:

Select it:

Select a function:

Result:

Example:

Enter the logarithm of the following number to the base 2:

To obtain this, select it and select logarithm function:

Then, put the cursor in the base box and enter the number "2":

Example:

Another means of using the logarithm: first type "log", then enter the index symbol.

When the base is entered, the cursor is moved to the position following the symbol:

After that, the argument is inserted:

Bear in mind that compound arguments require brackets. Therefore, there is only the number "10" in the logarithm argument in the next example:

In this case, the argument is represented by the sum:

Entering the angle measure, using the mathematical toolbar

The angle measure can be typed by selecting a symbol in the mathematical toolbar. Choose the necessary expression (select it when needed) and press the relevant symbol icon.

Example:

Radians are defined as the default angular measures. (Angular measure distribution can be adjusted in the settings dialog.) Choose the "degrees" measure for the sine function argument. To do this, put the cursor by the number:

Press the toolbar button:

Result:

Other measures can be applied in the same way.

Text lines

The text line is for edit box comments. It does not affect the computation. It is entered by pressing [Ctrl]-[T] or choosing the sign in the "+" button of the mathematical toolbar.

Example:

Press [Ctrl]-[T] and type "Earth radius". Then, press [Enter]. The new line starts with an ordinary clear symbol. Enter the variable value.