Math

Perform arithmetic, rounding, trigonometric, exponential, min/max, and smoothing operations on numbers and vectors.

What it does

Math performs arithmetic and mathematical functions on operands wired in or typed directly. It works across numbers, vectors, number lists, images and Volumes, matching pixels, voxels or list entries element-by-element and broadcasting a single number across the others. Add, Multiply, Power and the rest fold left-to-right across all operands; functions such as Sin, Sqrt and Abs act only on the first.

Operands start at two and grow with the + socket up to 64. An operand left unwired keeps whatever value was typed into its slider rather than being treated as zero, so a Multiply or Min chain still gives the expected answer with some pins disconnected.

When to use it

ParameterTypeDefault
input_countNumber2
operationString"Add"
smooth_kNumber10

Gotchas

An operand slot that is neither wired nor given a typed value is dropped entirely rather than folded in as 0, so removing a connection from a Multiply or Min chain does not zero the result.

Clamp and Smoothstep read exactly three operands (value/lo/hi and edge0/edge1/x). With fewer than three wired or typed, operand 0 passes through unchanged; add a third operand to get clamping or smoothstepping.

Smooth K appears only when Operation is SmoothMin or SmoothMax. It has no effect on any other operation, including plain Min and Max.

Worked example

  1. Add a Math node and set Operation to Add.

  2. Wire two images into Input 0 and Input 1 to add them pixel-by-pixel, or leave a slider unconnected and type a value to add a flat offset instead.

  3. Click the + socket to add a third operand, then switch Operation to Clamp to keep the combined result inside a lo/hi range.

  4. Switch Operation to SmoothMin and raise Smooth K to round off a hard minimum into a soft blend between two values.

See also

Vector Math · Mix · Fit · Numbers, signals & audio