Skip to content

Math Nodes

Math nodes in Databraid provide a wide range of mathematical operations and functions for performing calculations, transformations, and data processing within a braid. These nodes allow you to manipulate and analyze numeric data effectively.

Arithmetic Nodes

  • Operation: Performs basic arithmetic operations such as addition, subtraction, multiplication, and division on numeric inputs.
  • Accumulate: Accumulates and sums up numeric values over time, allowing you to keep a running total or aggregate values.
  • Average: Calculates the average value of a set of numeric inputs, providing a measure of central tendency.

Trigonometric Nodes

  • Trigonometry: Performs trigonometric functions such as sine, cosine, and tangent on numeric inputs, enabling you to work with angles and circular motion.

Comparison and Conditional Nodes

  • Compare: Compares two numeric values and outputs a boolean result based on the comparison operation (e.g., greater than, less than, equal to).
  • Condition: Evaluates a conditional expression and outputs a numeric value based on the result, allowing you to create branching logic.

Conversion Nodes

  • Converter: Converts numeric values between different units or scales, such as temperature, distance, or time.
  • To_Number: Converts a value of a different data type to its numeric representation, if possible.

Range and Interpolation Nodes

  • Range: Generates a sequence of numeric values within a specified range, with optional step size.
  • Lerp: Performs linear interpolation between two numeric values based on a third value, allowing for smooth transitions.
  • Smoothstep: Performs smooth interpolation between two numeric values based on a third value, using a sigmoid-like function.

Rounding and Truncation Nodes

  • Floor: Rounds down a numeric value to the nearest integer, discarding the fractional part.
  • Frac: Returns the fractional part of a numeric value, discarding the integer part.

Scaling and Mapping Nodes

  • Scale: Scales a numeric value from one range to another, allowing for normalization or mapping of values.
  • Clamp: Constrains a numeric value within a specified range, ensuring it falls between a minimum and maximum value.

Randomness and Noise Nodes

  • Rand: Generates a random numeric value within a specified range, providing a source of randomness.
  • Noise: Generates smooth, continuous noise values based on input coordinates, useful for creating natural-looking patterns or variations.

Miscellaneous Nodes

  • Abs: Calculates the absolute value of a numeric input, returning its magnitude without regard to its sign.
  • Bypass: Passes the numeric input value to the output without any modification, useful for creating alternate paths or bypassing operations.
  • Formula: Evaluates a mathematical formula based on input values, allowing for complex calculations and expressions.
  • Spikes: Detects and outputs spike or peak values in a numeric signal, useful for identifying sudden changes or anomalies.
  • TendTo: Gradually changes a numeric value towards a target value over time, creating a smoothing or easing effect.

These math nodes provide a comprehensive set of tools for performing mathematical operations and transformations within a braid. By combining and chaining these nodes together, you can create powerful numerical processing pipelines, data analysis workflows, and dynamic calculations.

Remember to refer to the individual node documentation for more details on their specific inputs, outputs, and configuration options, as well as examples and best practices for using them effectively in your braids.