dglux5_wiki:dataflow:dataflow_blocks_reference:math_operations:scale

Scale

Block Group: Math Operations
Icon:Scale block icon

The Scale block returns the result of re-scaling a number from one defined set of lower and upper limits to another.

Evaluation of the result is according to the following formula:

(input – inputMin) * ((outputMax – outputMin) / (inputMax – inputMin)) + outputMin = output

The result is limited to the range between outputMin and outputMax.

For information on using dataflow blocks, see Dataflow.

For accepted and excluded arguments of Math Operations blocks, see Math Operations.


The following properties of the Scale block can take input and give output.

  • input (number)
  • inputMin (number)
  • inputMax (number)
  • outputMin (number)
  • outputMax (number)

input specifies the number to re-scale.

inputMin specifies the minimum of the original scale.

inputMax specifies the maximum of the original scale.

outputMin specifies the minimum of the new scale.

outputMax specifies the maximum of the new scale. outputMax can be smaller than outputMin to reverse the scale.


The following properties of the Scale block can give output but cannot take input.

  • inputOutOfRange (boolean)
  • output (number)

inputOutOfRange returns TRUE if the input is outside the range from inputMin to inputMax, FALSE otherwise.

output returns the value in the new scale that corresponds to input in the old scale. If input is below the input range, output returns outputMin. If input is above the input range, output returns outputMax. If inputMin equals inputMax, output returns outputMin when input is below that value, and outputMax otherwise.


The following image shows four examples of the Scale block.

Scale block examples


  • dglux5_wiki/dataflow/dataflow_blocks_reference/math_operations/scale.txt
  • Last modified: 2026/10/22 13:25
  • by 127.0.0.1