Mathematics

The blocks in the mathematics category are used to activate calculations. The results of the calculations can be used, for example, as values for variables. Most mathematic blocks relate to general mathematical calculations, and should be self-explanatory.

Blocks

Facts and Figures

Use the number block to enter any number into your program, or assign this number to a variable as a value. This program assigns the number 12 to the variable age :

Bild1_e.PNG

Simple calculations

This block has the structure value - operator - value. The available operators are +-÷× and ^. The operator can be selected via the drop down menu. It can be applied directly to numbers, or to values of variables. Example:

Bild2.PNG

This block outputs the result 144 (12^2).

Specialized calculations

This block applies the type of calculation selected from the drop down menu to the number behind it or the variable behind it. The available operations are:

e here is Euler’s number. This block takes the square root of 16 and sets the variable to the result.

Bild3_e.PNG

 

Trigonometric functions

This block works similarly to the block described above, with the difference that the trigonometric functions sine, cosine, tangent, and their inverse functions are used. The number indicated or the value of the variable indicated is therefore inserted into the function selected in the drop down menu, and the result can then be processed in the program. In addition, there is also the block arctan2 of X: ... Y: ..., which makes it possible to use two real numbers (to be entered as X and Y) to output a function value for the arctan2 in a range of 360°.

Frequently used constants

This block works similarly to the number block, however you do not enter the numerical value here yourself. Instead, frequently used constants (such as π) are saved here as defaults. The constants can be selected via the drop down menu.

Remainder of a division

The remainder of ... block is used to output the remainder of a division. This program assigns the variable remainder to the remainder of the devision of 3:2, or 1:

Bild4_e.PNG

Round

The round ... block can be used to round an entered decimal number of the value of an entered variable to a whole number. You can choose from three options in the drop down menu:

Evaluating lists

You can use the ... of the list block to output 

. You can select all of these options using the drop down menu for the block:

Bild5_e.PNG

Constrain input values

The constrain ... from ... to block allows you to constrain input values to a certain interval. Before an input value is processed, a test is conducted to check whether it is in the defined interval. There are three options for handling an entered value:

In this example, the block is used to constrain the value for the variable speed to the speeds supported by the motor:

Bild6_e.PNG

Generate random values

The two blocks random number from ... to... and random break  output a random value. The random number from ... to...  block outputs a number from the defined interval. The block random break, in contrast, outputs a value between 0.0 (and may include this number) and 1.0 (may not include this number).


Revision #1
Created 21 February 2022 15:50:52 by Admin
Updated 9 January 2023 10:29:05 by Admin