Skip to content

Math

All Node Variations

All Math Node Variations

All Math operations have the ability to blend (Mix) between value 1 and the result of the operation

Italicized words are the names of the inputs

Mix

Blend the value inputs via the Fac(tor) input

Add

The sum of the two values.

\(Value 1 + Value 2\)

Example

\(1 + 2 = 3\)

Subtract

The difference between the two values

\(Value 1 - Value 2\)

Example

\(1 - 2 = -1\)

Multiply

The product of the two values

\(Value 1 * Value 2\)

Example

\(3 * 2 = 6\)

Divide

The division of the first value by the second value.

\(Value 1 / Value 2\)

Example

\(\frac{6}{2} = 3\)

Multiply Add

The sum of the product of the two values with Addend.

\(Value * Multiplier + Addend\)

Power

The Base raised to the power of Exponent.

\(Base^Exponent\)

Example

\(3^2 = 9\)

Logarithm

The log of the value with a Base as its base.

\(log_{Base}(Value)\)

Example

\(log_3(3) = 1.0986122886681098\)

Square Root

The square root of the value.

\(\sqrt{Value}\)

Example

\(\sqrt{4} = 2\)

Inverse Square Root

One divided by the square root of the value.

\(\frac{1}{\sqrt{Value}}\)

Example

\(\frac{1}{\sqrt{4}} = 0.5\)

Absolute

The input value is read with without regard to its sign. This turns negative values into positive values.

\(| Value |\)

Example

  • \(| -2 | = 2\)
  • \(| 5 | = 5\)

Exponent

Raises Euler’s number to the power of the value.

\(e^{Value}\)

Example

\(e^5 = 148.41315910257657\)

Minimum

Outputs the smallest of the input values. Returns the smallest value

\(\min({Value 1}, {Value 2})\)

Example

  • \(\min({3}, {7}) = 3\)
  • \(\min({10}, {-8}) = -8\)

Maximum

Outputs the largest of two input values. Returns the largest value

\(\max({Value 1}, {Value 2})\)

Example

  • \(\max({3}, {7}) = 7\)
  • \(\max({10}, {-8}) = 10\)

Less Than

Outputs 1.0 if the first value is smaller than the second value. Otherwise the output is 0.0. Returns 1 if True, 0 if False

\(Value < Threshold\)

Example

  • \(3 < 7 = 1 (True)\)
  • \(10 < -8 = 0 (False)\)

Greater Than

Outputs 1.0 if the first value is larger than the second value. Otherwise the output is 0.0. Returns 1 if True, 0 if False

\(Value > Threshold\)

Example

  • \(3 > 7 = 0 (False)\)
  • \(10 > -8 = 1 (True)\)

Sign

Extracts the sign of Value. All positive numbers will output 1.0. All negative numbers will output -1.0. And 0.0 will output 0.0.

Example

  • \(sign(3) = 1.0\)
  • \(sign(-50.758) = -1.0\)
  • \(sign(0) = 0.0\)

Compare

Outputs 1.0 if the difference between Value 1 and Value 2 is less than or equal to Epsilon.

\(|Value 1 - Value 2| \leq Epsilon\)

Example

  • \(|0.5 - 0.7| \leq 0.0\)
  • Returns 0.0 (False)
  • \(|0.5 - 0.7| \leq 0.2\)
  • Returns 1.0 (True)

Smooth Minimum

Like the Minimum function but rounded instead of pointed (linear)

Smooth Minimum

Smooth Maximum

Like the Maximum function but rounded instead of pointed (linear)

Smooth Maximum

Round

Round Value to nearest whole number

Example

  • \(round(0.5) = 0.0\)
  • \(round(0.51) = 1.0\)
  • \(round(5.25) = 5.0\)
  • \(round(5.75) = 6.0\)

Floor

Round Value down to a whole number

Example

  • \(floor(0.5) = 0.0\)
  • \(floor(0.51) = 0.0\)
  • \(floor(5.25) = 5.0\)
  • \(floor(5.75) = 5.0\)

Ceil

Round Value up to a whole number

Example

  • \(ceil(0.5) = 1.0\)
  • \(ceil(0.51) = 1.0\)
  • \(ceil(5.25) = 6.0\)
  • \(ceil(5.75) = 6.0\)

Fraction

Returns everything after the decimal point of Value

Example

  • \(fraction(0.5) = 0.5\)
  • \(fraction(0.51) = 0.51\)
  • \(fraction(5.25) = 0.25\)
  • \(fraction(5.75) = 0.75\)

Truncate

Outputs the integer part of the Value

Example

  • \(truncate(0.5) = 0.0\)
  • \(truncate(0.51) = 0.0\)
  • \(truncate(5.25) = 5.0\)
  • \(truncate(5.75) = 5.0\)

Modulo

Outputs the remainder once Value 1 is divided by Value 2.

\(Value 1 \% Value 2\)

OR

\(Value 1 - Value 2 * floor(\frac{Value 1}{Value 2})\)

Example

  • \(5 \% 3 = 2\)
  • \(5 \% 2 = 1\)

Wrap

Outputs a value between Min and Max based on the absolute difference between Value and the nearest integer multiple of Max less than the Value. Assume Min is 0.0 and Max is 0.1. The result of wrap increase as Value increase. BUT once Value = Max the result goes back to 0.0 and starts over.

Example

Assume: Min = 0.0, Max = 0.2

  • \(wrap(0.05) = 0.05\)
  • \(wrap(0.175) = 0.175\)
  • \(wrap(0.2) = 0.0\)
  • \(wrap(0.2 + 0.05) = 0.05\)
  • \(wrap(0.2 + 3.175) = 0.1\)

Snap

Round Value down to the nearest integer multiple of Increment.

\(floor( Value 1, Increment ) * Increment\)

Example

  • \(snap(0.5, 0.2) = 0.4\)
  • \(snap(0.51, 0.2) = 0.4\)
  • \(snap(7.25, 1) = 7\)
  • \(snap(5.75, 1) = 5\)

Ping-Pong

The output value is moved between 0.0 and the Scale based on the input value. Like Wrap but with a linear progression back down to 0 instead of instantly at 0

Example

Assume Scale = 0.2

  • \(pingpong(0.05) = 0.05\)
  • \(pingpong(0.175) = 0.175\)
  • \(pingpong(0.2) = 0.2\)
  • \(pingpong(0.2 + 0.05) = 0.195\)
  • \(pingpong(0.2 + 0.175) = 0.025\)

Sine

The Sine of Value

\(\sin(Value)\)

Cosine

The Cosine of Value

\(\cos(Value)\)

Tangent

The Tangent of Value

\(\tan(Value)\)

Arcsine

The Arcsine of Value

\(\arcsin(Value)\)

Arccosine

The Arccosine of Value

\(\arccos(Value)\)

Arctangent

The Arctangent of Value

\(\arctan(Value)\)

Arctan2

Outputs the Inverse Tangent of the first value divided by the second value measured in radians.

\(\arctan2(Value)\)

Hyperbolic Sine

The Hyperbolic Sine of Value

Hyperbolic Cosine

The Hyperbolic Cosine of Value

Hyperbolic Tangent

The Hyperbolic Tangent of Value

To Radians

Converts Degrees to radians

\(Degrees * \frac{\pi}{180}\)

Example

  • \(toRadians(180) = \pi\)
  • \(toRadians(90) = \frac{\pi}{2}\)

To Degrees

Converts Radians to degrees

\(Radians * \frac{180}{\pi}\)

Example

  • \(toDegrees(\pi) = 180\)
  • \(toDegrees(\frac{\pi}{2}) = 90\)

Clamp

Limits the output to be between the Min and Max

\(clamp(Value, Min, Max) = \max(Min, \min(Max, Value))\)

Example

  • \(clamp(-1, 0, 1) = 0\)
  • \(clamp(2, 0, 1) = 1\)
  • \(clamp(0.56, 0, 1) = 0.56\)