Arithmetic Category¶
- The following list shows the Arithmetic Category Magma nodes available in Krakatoa MX 2.x.
Abs¶
- The Abs operator calculates the Absolute value of the input value.
- The Abs operator has one inputs and one output.
![]()
Input 1: Value
- The Input can be an Int, Float, or Vector Value.
- In the case of Vector, the operator will be applied to each of the Vector’s components.
- Quat values are not supported.
- The input has no default value when unconnected.
Output 1: Abs
- The Output is the Absolute (unsigned) Value of the Input Value.
- The Properties and Actions rollout of the node exposes no additional properties.
- Examples:
Add¶
- The Add operator adds two values and outputs their sum.
- The Add operator has two inputs and one output.
![]()
Input 1: Left Value
- The first Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has a default of 0, 0.0 or [0,0,0] when unconnected, depending on the Input Defaults > Value Type specified in the node’s properties.
Input 2: Right Value
- The second Input must match the type of the Input 1 Value.
- The Input has a default of 0, 0.0 or [0,0,0] when unconnected, depending on the Input Defaults > Type specified in the node’s properties.
Output 1: Add
- The Output is the Sum of the two Input Values.
- The Properties and Actions rollout of the node defines:
- Value Type:
- Int - both Inputs will default to Int values when unconnected.
- Float (default) - both Inputs will default to Float values when unconnected.
- Vector - both Inputs will default to Vector values when unconnected.
- Left Value - defines the default value for the first input, default is 0.0.
- Right Value - defines the default value of the second input, default is 0.0.
- Value Type:
- Examples:
Ceil¶
- The Ceil operator produces the closest whole number that is greater or equal to the input, thus rounding it up.
- The Ceil operator has one input and one output.
![]()
Input 1: Value
- The Input can be a Float or a Vector Value.
- Int and Quat values are not supported.
- The Input has no default value when unconnected.
Output 1: Ceil
- The Output is the input value, rounded up to the nearest whole number.
- The Properties and Actions rollout of the node exposes no additional properties.
- Examples:
Divide¶
- The Divide operator calculates the quotient of two inputs.
- The Divide operator has two inputs and one output.
![]()
Input 1: Dividend
- The Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected, making 1 over a value easier to set up.
Input 2: Divisor
- The second Input can be Float when Input 1 is a Float or a Vector value.
- The second Input can be Vector when Input 1 is also a Vector value.
- The second Input can be Int when Input 1 is a also an Int value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected, making sure the Dividend is not changed unless the Divisor is explicitly set or connected to an InputValue.
Output 1: Divide
- The Output is the first Input value, divided by the second Input.
- The Properties and Actions rollout of the node defines:
- Value Type:
- Int - both Inputs will default to Int values when unconnected.
- Float (default) - both Inputs will default to Float values when unconnected.
- Vector - both Inputs will default to Vector values when unconnected.
- Dividend - defines the default value for the first input, default is 1.0.
- Divisor - defines the default value of the second input, default is 1.0.
- Value Type:
- Examples:
Floor¶
- The Floor operator produces the closest whole number that is less than or equal to the input, thus rounding it down.
- The Floor operator has one input and one output.
![]()
Input 1: Value
- The Input can be a Float or a Vector Value.
- Int and Quat values are not supported.
- The Input has no default value when unconnected.
Output 1: Floor
- The Output is the input value, rounded down to the nearest whole number.
- The Properties and Actions rollout of the node exposes no additional properties.
- Examples:
Log¶
- The Log operator calculates the Natural Logarithm of the input value.
- The Log operator has one input and one output.
![]()
Input 1: Base
- The Input can be only a Float value.
- Int, Vector and Quat values are not supported.
- The Input has no default value when unconnected.
Output 1: Log
- The Output is the Natural Logarithm of the input value, so that Input = e ^ Output.
- The Properties and Actions rollout of the node exposes no additional properties.
- Examples:
- NOTE: Krakatoa MX ships with two pre-defined BlackOps found under BLOP Category > Logarithms:
- LogBase for calculating the logarithm with a user-defined base.
![]()
![]()
- Log10 for calculating the logarithm with base of 10.
![]()
![]()
Modulo¶
- The Modulo operator calculates the remainder of the quotient of two values.
- The Modulo operator has two inputs and one output.
![]()
Input 1: Dividend
- The Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has a default value of 0 when unconnected.
Input 2: Divisor
- The second Input can be Float when Input 1 is a Float or a Vector value.
- The second Input can be Vector when Input 1 is also a Vector value.
- The second Input can be Int when Input 1 is a also an Int value.
- Quat values are not supported.
- The Input has a default value of 1 when unconnected.
Output 1: Divide
- The Output is remainder of the division of the two Input values.
- The Properties and Actions rollout of the node defines:
- Value Type:
- Int (default) - both Inputs will default to Int values when unconnected.
- Float - both Inputs will default to Float values when unconnected.
- Vector - both Inputs will default to Vector values when unconnected.
- Dividend - defines the default value for the first input, default is 0.
- Divisor - defines the default value of the second input, default is 1.
- Value Type:
- Examples:
Multiply¶
- The Multiply operator calculates the product of two input values.
- The Multiply operator has two inputs and one output.
![]()
Input 1: Left Value
- The first Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected, making sure the Right Value would not be modified by default.
Input 2: Right Value
- The second Input can be Float when Input 1 is a Float or a Vector value.
- The second Input can be Vector when Input 1 is also a Vector value.
- The second Input can be Int when Input 1 is a also an Int value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected, making sure the Left Value would not be changed by default.
Output 1: Multiply
- The Output is the first Input value multiplied by the second Input.
- The Properties and Actions rollout of the node defines:
- Value Type:
- Int - both Inputs will default to Int values when unconnected.
- Float (default) - both Inputs will default to Float values when unconnected.
- Vector - both Inputs will default to Vector values when unconnected.
- Left Value - defines the default value for the first input, default is 1.0.
- Right Value - defines the default value of the second input, default is 1.0.
- Value Type:
- Examples:
Negate¶
- The Negate operator inverts the sign of the input value.
- The Negate operator has one input and one output.
![]()
Input 1: Value
- The Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has no default value when unconnected.
Output 1: Multiply
- The Output is the Input value with inverse sign.
- The Properties and Actions rollout of the node exposes no additional properties.
Power¶
- The Power operator calculates the first input to the power of the second input.
- The Power operator has two inputs and one output.
![]()
Input 1: Base
- The first Input can be an Int, Float, or Vector Value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected.
Input 2: Exponent
- The second Input can be Float when Input 1 is a Float or a Vector value.
- The second Input can be Vector when Input 1 is also a Vector value.
- The second Input can be Int when Input 1 is a also an Int value.
- Quat values are not supported.
- The Input has a default value of 1.0 when unconnected, making sure the Base would not be changed by default.
Output 1: Multiply
- The output is the first input multiplied by itself second input times.
- The Properties and Actions rollout of the node defines:
- Value Type:
- Int - both Inputs will default to Int values when unconnected.
- Float (default) - both Inputs will default to Float values when unconnected.
- Vector - both Inputs will default to Vector values when unconnected.
- Base - defines the default value for the first input, default is 1.0.
- Exponent - defines the default value of the second input, default is 1.0.
- Value Type:
- Examples:
Sqrt¶
- The Sqrt operator has one input and one output.
![]()
Input 1: Value
- The input must be of type Float.
- The input does not have a default value when unconnected.
Output 1: Multiply
- The output is the positive square root of the input.
- Examples:
Subtract¶
- The Subtract operator has two inputs and one output.
Input 1: Value
- The first input can be a Vector, a Float or an Integer
- The first input has a Float default value of 1.0 when unconnected.
Input 2: Value
- The second input must match the first input’s type
- The second input has a default value of 0.0 when unconnected.
- The default type can be switched between Vector, Float and Integer.
Output 1: Subtract
- The output is the difference between the two inputs.
- Examples:
