Math Node

From RoboPad Wiki
Jump to navigation Jump to search

← Return to Node Catalogue

Math Node
Inputs
  • a
  • b
  • [...N]
Outputs
  • result
Version Introduced
2.3-b1

The Math Node is a simple node that performs basic mathematical computation on signals passed into it's input ports. It can have two or more input ports. It is important to note that the Math Node will only emit a result when all inputs have been populated (a.k.a. all input ports are connected to other nodes).

Math Nodes were introduced in firmware version 2.3-b1.

Settings

The Math Node only has two settings:

  • Function: Specifies the mathematical operator this node will use on it's input signals. See "Operators List" below for more information on the behaviour of each operator.
  • Input Count: Specifies how many inputs this operator will act over. Note that all inputs must be connected to other nodes.

Operators List

The Math Node has a number of operators that can be selected. Binary operators operate on two or more input signals - they iteratively combine each input, for instance, using an addition ("add") operator with 3 inputs, a, b & c, will produce a result of a+b+c. Similarly, a division operator ("divide") will result in (a/b)/c, iteratively operating the output of the output of the operator on the first two with the next, and then the next until the end of the input list. If you provide just a single input to a binary operator no operation will occur and the value will simply be forwarded to the result.

Unary operators only act on the first input value, however just like when using a binary operator those values must still be connected to other nodes for the Math Node to output a value, so it is best to reduce Input Count to 1 when using a unary operator.

Binary Operators

  • add                                                                                                                                           
  • subtract
  • multiply
  • divide
  • min
  • max
  • mod
  • pow
  • atan2

Unary Operators

  • sqrt
  • abs
  • sin
  • cos
  • tan
  • asin
  • acos
  • atan
  • log
  • exp
  • floor
  • ceil
  • round
  • sign