<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ShaderGraph-Docs",
  "identifier" : "/documentation/ShaderGraph/Math",
  "metadataVersion" : "0.1.0",
  "role" : "ShaderGraph Node Group",
  "symbol" : {
    "kind" : "ShaderGraph Node Group",
    "modules" : [
      "ShaderGraph"
    ],
    "preciseIdentifier" : "math"
  },
  "title" : "Math"
}
-->

# Math

Perform a wide variety of mathematical and transformative operations on data values.

## Overview

Include `Math` nodes in your graph to perform typical mathematical operations on data values. A wide range of nodes are available, supporting basic arithmetic, trigonometry, logs, exponents, dot and cross products, and more. Some nodes operate on specific data types of values, but most operate on a wide range of data types, including numbers, colors, and vectors.

## Topics

### Nodes

[`Add`](/documentation/ShaderGraph/Math/Add)

Adds two values.

[`Subtract`](/documentation/ShaderGraph/Math/Subtract)

Subtracts two values.

[`Multiply`](/documentation/ShaderGraph/Math/Multiply)

Multiplies two values.

[`Divide`](/documentation/ShaderGraph/Math/Divide)

Divides two values.

[`Modulo`](/documentation/ShaderGraph/Math/Modulo)

Outputs the remaining fraction after dividing the input by a value and subtracting the integer portion.

[`Abs`](/documentation/ShaderGraph/Math/Abs)

Outputs the per-channel absolute value of the input.

[`Floor`](/documentation/ShaderGraph/Math/Floor)

Outputs the nearest integer value, per-channel, less than or equal to the incoming values.

[`Ceiling`](/documentation/ShaderGraph/Math/Ceiling)

Outputs the nearest integer value, per-channel, greater than or equal to the incoming values.

[`Power`](/documentation/ShaderGraph/Math/Power)

Raises the incoming value to an exponent.

[`Sin`](/documentation/ShaderGraph/Math/Sin)

The sine of the incoming value in radians.

[`Cos`](/documentation/ShaderGraph/Math/Cos)

The cosine of the incoming value in radians.

[`Tan`](/documentation/ShaderGraph/Math/Tan)

The tangent of the incoming value in radians.

[`Asin`](/documentation/ShaderGraph/Math/Asin)

The arcsine of the incoming value in radians.

[`Acos`](/documentation/ShaderGraph/Math/Acos)

The arccosine of the incoming value in radians.

[`Atan2`](/documentation/ShaderGraph/Math/Atan2)

The arctangent of the expression (iny/inx) in radians.

[`Square Root`](/documentation/ShaderGraph/Math/Square-Root)

The square root of the incoming value.

[`Natural Log`](/documentation/ShaderGraph/Math/Natural-Log)

The natural log of the input.

[`Exp`](/documentation/ShaderGraph/Math/Exp)

Outputs ‘e’ to the power of the input.

[`Sign`](/documentation/ShaderGraph/Math/Sign)

The per-channel sign of the input value: -1 for negative, +1 for positive, 0 for zero.

[`Clamp`](/documentation/ShaderGraph/Math/Clamp)

Clamps the input per-channel to a specified range.

[`Min`](/documentation/ShaderGraph/Math/Min)

Outputs the minimum of two incoming values.

[`Max`](/documentation/ShaderGraph/Math/Max)

Outputs the maximum of two incoming values.

[`Normalize`](/documentation/ShaderGraph/Math/Normalize)

Outputs a normalized vector.

[`Magnitude`](/documentation/ShaderGraph/Math/Magnitude)

Outputs the float magnitude of a vector.

[`Dot Product`](/documentation/ShaderGraph/Math/Dot-Product)

Outputs the dot product of two vectors.

[`Cross Product`](/documentation/ShaderGraph/Math/Cross-Product)

Calculates the cross product vector of 2 input vectors.

[`Transform Point`](/documentation/ShaderGraph/Math/Transform-Point)

Transforms a coordinate from one space to another.

[`Transform Vector`](/documentation/ShaderGraph/Math/Transform-Vector)

Transforms a vector3 from one space to another.

[`Transform Normal`](/documentation/ShaderGraph/Math/Transform-Normal)

Transforms a normal from one space to another.

[`Transform Matrix`](/documentation/ShaderGraph/Math/Transform-Matrix)

Transforms a vector by a matrix.

[`Transpose`](/documentation/ShaderGraph/Math/Transpose)

Outputs the tranpose of a matrix.

[`Determinant`](/documentation/ShaderGraph/Math/Determinant)

Outputs the float determinant of a matrix.

[`Invert Matrix`](/documentation/ShaderGraph/Math/Invert-Matrix)

Outputs the inverse of a matrix.

[`Rotate 2D`](/documentation/ShaderGraph/Math/Rotate-2D)

Rotates a Vector2 (Float) about the origin in 2D.

[`Rotate 3D`](/documentation/ShaderGraph/Math/Rotate-3D)

Rotates a Vector3 (Float) about a specified unit axis vector.

[`Place 2D`](/documentation/ShaderGraph/Math/Place-2D)

Transforms UV texture coordinates for 2D texture placement.

[`Round`](/documentation/ShaderGraph/Math/Round)

Rounds to the nearest integer value, per-channel.

[`Safe Power`](/documentation/ShaderGraph/Math/Safe-Power)

Raises the incoming value to an exponent and assigns the sign of the base to the output.

[`Normal Map`](/documentation/ShaderGraph/Math/Normal-Map)

Transforms a normal vector from object or tangent space into world space.

[`Fractional (RealityKit)`](/documentation/ShaderGraph/Math/Fractional-(RealityKit))

Returns the fractional part of a floating point number.

[`One Minus (RealityKit)`](/documentation/ShaderGraph/Math/One-Minus-(RealityKit))

Outputs one minus the input.

[`Normal Map Decode`](/documentation/ShaderGraph/Math/Normal-Map-Decode)

Remaps a normal’s value from [0,1] to [-1,1] by applying 2x-1.

[`Max3 (RealityKit)`](/documentation/ShaderGraph/Math/Max3-(RealityKit))

Outputs the maximum of three incoming values.

[`Min3 (RealityKit)`](/documentation/ShaderGraph/Math/Min3-(RealityKit))

Outputs the minimum of three incoming values.

[`Fractional (RealityKit)`](/documentation/ShaderGraph/Math/Fractional-(RealityKit))

Returns the fractional part of a floating point number.

[`Inverse Hyperbolic Cos`](/documentation/ShaderGraph/Math/Inverse-Hyperbolic-Cos)

The inverse hyperbolic cosine of the incoming value in radians.

[`Inverse Hyperbolic Sin`](/documentation/ShaderGraph/Math/Inverse-Hyperbolic-Sin)

The inverse hyperbolic sine of the incoming value in radians.

[`Atan`](/documentation/ShaderGraph/Math/Atan)

The arctangent of the incoming value in radians.

[`Inverse Hyperbolic Tan`](/documentation/ShaderGraph/Math/Inverse-Hyperbolic-Tan)

The hyperbolic arc tangent of the incoming value in radians.

[`Copy Sign (RealityKit)`](/documentation/ShaderGraph/Math/Copy-Sign-(RealityKit))

Return x with its sign changed to match the sign of y.

[`Hyperbolic Cos`](/documentation/ShaderGraph/Math/Hyperbolic-Cos)

The hyperbolic cosine of the incoming value in radians.

[`Cos Pi (RealityKit)`](/documentation/ShaderGraph/Math/Cos-Pi-(RealityKit))

Compute cos(πX).

[`Exponential 2 (RealityKit)`](/documentation/ShaderGraph/Math/Exponential-2-(RealityKit))

Exponential Base 2 of X.

[`Exponential 10 (RealityKit)`](/documentation/ShaderGraph/Math/Exponential-10-(RealityKit))

Exponential Base 10 of X.

### Subscripts

[`Distance (RealityKit)`](/documentation/ShaderGraph/Math/Distance-(RealityKit))

Returns the distance between X and Y.

[`Distance Square (RealityKit)`](/documentation/ShaderGraph/Math/Distance-Square-(RealityKit))

Returns the square of the distance between X and Y.

[`Fused Multiply-Add (RealityKit)`](/documentation/ShaderGraph/Math/Fused-Multiply-Add-(RealityKit))

Returns (A * B) + C.

[`Hyperbolic Sin`](/documentation/ShaderGraph/Math/Hyperbolic-Sin)

The hyperbolic sine of the incoming value in radians.

[`Hyperbolic Tan`](/documentation/ShaderGraph/Math/Hyperbolic-Tan)

The hyperbolic tangent of the incoming value in radians.

[`Log 10`](/documentation/ShaderGraph/Math/Log-10)

The log base 10 of the input.

[`Log 2`](/documentation/ShaderGraph/Math/Log-2)

The log base 2 of the input.

[`Magnitude Square (RealityKit)`](/documentation/ShaderGraph/Math/Magnitude-Square-(RealityKit))

Outputs the float magnitude of a vector, squared.

[`Median3 (RealityKit)`](/documentation/ShaderGraph/Math/Median3-(RealityKit))

Returns the middle value of three incoming values.

[`Modulo (RealityKit)`](/documentation/ShaderGraph/Math/Modulo-(RealityKit))

Outputs the remaining fraction after dividing the input by a value and subtracting the integer portion.

[`Reciprocal Square Root (RealityKit)`](/documentation/ShaderGraph/Math/Reciprocal-Square-Root-(RealityKit))

Computes inverse square root of X.

[`Sin Pi (RealityKit)`](/documentation/ShaderGraph/Math/Sin-Pi-(RealityKit))

Compute sin(πX).

[`Tan Pi (RealityKit)`](/documentation/ShaderGraph/Math/Tan-Pi-(RealityKit))

Compute tan(πX).

[`Truncate (RealityKit)`](/documentation/ShaderGraph/Math/Truncate-(RealityKit))

Rounds X to integral value using the round-toward-zero rounding mode.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)