DocsNodesValues

Math

Does arithmetic on a number, or on a value that varies across a surface.

add, subtract, multiply, divide, arithmetic, sine, modulo, calculate
Category
Values
Outputs
value
Runs live in
Godot, Roblox

Add, multiply, take a minimum, take a sine. It works the same on a single number and on a value that changes from point to point, so the same node scales a knob or reshapes a noise pattern.

Reach for it when the relationship really is arithmetic. When what you want is a shape, a curve through a handful of points, use Value Ramp instead: a profile drawn with four stops replaces a dozen of these.

Inputs

SocketTypeWiring
fieldAfield, optional
fieldBfield, optional

Parameters

NameTypeDefaultAvailable whenWhat it does
typeAdd | Subtract | Multiply | Divide | Sine | Cosine | Tangent | Modulo | Floor | Round | Absolute | Minimum | Maximum | Sqrt | Power | ArctangentAddalwaysSine, Cosine and Tangent work in radians, while every rotation setting in the editor is in degrees. If one number feeds both, multiply it by 0.017453 on the way into the trig. Arctangent is the two-input kind: it reads both sockets together and gives the angle around the origin, which is what you want for anything that fans out radially.
inputAnumber0always
inputBnumber0always

Watch out

A sine that runs far too fast is usually degrees fed into something expecting radians. One full cycle is about 6.28, not 360.

Built with this node

2 more teaching graphs use it without being about it.

See also

  • valueRampWhen you are drawing a shape rather than doing arithmetic. It replaces long Math chains.
  • mapRangeTo move a value from one range onto another, which is the most common thing a Math chain is doing by hand.

Open the editor and try it