Math: Arithmetic

Nodes in this category perform common arithmetic operations on numerical values (and where applicable, vec2 values).

Nodes

NodeDetailsPossible Types
Add

The addition operation (+) calculates the sum of two scalar numbers or vec2s.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Divide

The division operation (÷) calculates the quotient of two scalar numbers or vec2s.

Produces 0 for any division by 0. With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Exponent

The exponent operation (^) calculates the result of raising a number to a power.

With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Logarithm

The logarithmic function (log) calculates the logarithm of a number with a specified base. If the natural logarithm function (ln) is desired, set the base to "e".

With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Math

Calculates a mathematical expression with input values "A" and "B".

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Modulo

The modulo operation (%) calculates the remainder from the division of two scalar numbers or vec2s.

The sign of the result shares the sign of the numerator unless Always Positive is enabled.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Multiply

The multiplication operation (×) calculates the product of two scalar numbers, vec2s, or transforms.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Transform → Transform
Transform[] → Transform[]
Reciprocal

The reciprocal operation (1/x) calculates the multiplicative inverse of a number.

Produces 0 if the input is 0. With a vec2 input, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
Root

The nth root operation () calculates the inverse of exponentiation. Square root inverts squaring, cube root inverts cubing, and so on.

This is equivalent to raising the number to the power of 1/n. With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Subtract

The subtraction operation (-) calculates the difference between two scalar numbers or vec2s.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]